Merge lp:~mwhudson/launchpad/apoca-publish-code into lp:launchpad
- apoca-publish-code
- Merge into devel
Proposed by
Michael Hudson-Doyle
Status: | Merged |
---|---|
Approved by: | Curtis Hovey |
Approved revision: | no longer in the source branch. |
Merged at revision: | 11202 |
Proposed branch: | lp:~mwhudson/launchpad/apoca-publish-code |
Merge into: | lp:launchpad |
Prerequisite: | lp:~mwhudson/launchpad/code-publisher-in-lp.code |
Diff against target: |
2578 lines (+590/-364) 40 files modified
lib/canonical/configure.zcml (+8/-8) lib/canonical/launchpad/doc/webapp-publication.txt (+3/-31) lib/canonical/launchpad/layers.py (+0/-18) lib/canonical/launchpad/webapp/meta.zcml (+1/-1) lib/canonical/launchpad/webapp/metazcml.py (+29/-35) lib/canonical/launchpad/webapp/servers.py (+7/-58) lib/canonical/launchpad/webapp/tests/test_servers.py (+27/-42) lib/canonical/launchpad/zcml/marketing.zcml (+12/-12) lib/lp/answers/browser/configure.zcml (+2/-2) lib/lp/answers/browser/tests/views.txt (+1/-1) lib/lp/answers/configure.zcml (+5/-1) lib/lp/answers/publisher.py (+41/-0) lib/lp/answers/tests/test_publisher.py (+49/-0) lib/lp/app/tests/test_help.py (+7/-5) lib/lp/blueprints/browser/configure.zcml (+2/-2) lib/lp/blueprints/browser/tests/test_specificationtarget.py (+3/-3) lib/lp/blueprints/configure.zcml (+5/-1) lib/lp/blueprints/publisher.py (+34/-0) lib/lp/blueprints/tests/test_publisher.py (+39/-0) lib/lp/bugs/browser/malone.py (+2/-2) lib/lp/bugs/browser/tests/test_configure_bugtracker_links.py (+2/-1) lib/lp/bugs/configure.zcml (+5/-1) lib/lp/bugs/publisher.py (+34/-0) lib/lp/bugs/tests/test_publisher.py (+39/-0) lib/lp/code/tests/test_publisher.py (+0/-6) lib/lp/registry/browser/configure.zcml (+19/-19) lib/lp/translations/browser/configure.zcml (+101/-101) lib/lp/translations/browser/tests/language-views.txt (+1/-1) lib/lp/translations/browser/tests/poexport-request-views.txt (+1/-1) lib/lp/translations/browser/tests/pofile-views.txt (+1/-1) lib/lp/translations/browser/tests/potemplate-views.txt (+1/-1) lib/lp/translations/browser/tests/test_translationimportqueueentry.py (+2/-1) lib/lp/translations/browser/tests/translationimportqueue-views.txt (+2/-1) lib/lp/translations/browser/tests/translationmessage-views.txt (+1/-1) lib/lp/translations/browser/tests/translator-views.txt (+3/-3) lib/lp/translations/browser/translations.py (+3/-2) lib/lp/translations/configure.zcml (+5/-1) lib/lp/translations/doc/rosetta-karma.txt (+1/-1) lib/lp/translations/publisher.py (+42/-0) lib/lp/translations/tests/test_publisher.py (+50/-0) |
To merge this branch: | bzr merge lp:~mwhudson/launchpad/apoca-publish-code |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Curtis Hovey (community) | code | Approve | |
Review via email:
|
Commit message
Move application specific publishing code into lp.$application
Description of the change
Following on from lp:~mwhudson/launchpad/code-publisher-in-lp.code, this branch moves all application specific publication code into lp.$application
I'm afraid I expect it's a bit of a beast to review -- a mix of a load of literally mechanical import fixups and a little bit of deep stuff. Let me know if you want me to prepare this branch in another, easier to review, way.
To post a comment you must log in.
Revision history for this message
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Robert Collins (lifeless) wrote : | # |
Revision history for this message
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Curtis Hovey (sinzui) wrote : | # |
This looks fine to land after you very that make lint is happy. I think the imports of unittest are no longer needed in a few modules.
/me is reminded that if he could set the alias to /blueprint, he would fix the project name.
review:
Approve
(code)
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'lib/canonical/configure.zcml' | |||
2 | --- lib/canonical/configure.zcml 2010-07-22 01:48:51 +0000 | |||
3 | +++ lib/canonical/configure.zcml 2010-07-22 20:59:01 +0000 | |||
4 | @@ -85,14 +85,14 @@ | |||
5 | 85 | <browser:defaultView | 85 | <browser:defaultView |
6 | 86 | for="canonical.launchpad.interfaces.ILaunchpadRoot" | 86 | for="canonical.launchpad.interfaces.ILaunchpadRoot" |
7 | 87 | name="specs" | 87 | name="specs" |
9 | 88 | layer="canonical.launchpad.layers.BlueprintsLayer" | 88 | layer="lp.blueprints.publisher.BlueprintsLayer" |
10 | 89 | /> | 89 | /> |
11 | 90 | <browser:page | 90 | <browser:page |
12 | 91 | name="" | 91 | name="" |
13 | 92 | for="canonical.launchpad.interfaces.ILaunchpadRoot" | 92 | for="canonical.launchpad.interfaces.ILaunchpadRoot" |
14 | 93 | class="canonical.launchpad.browser.launchpad.LaunchpadImageFolder" | 93 | class="canonical.launchpad.browser.launchpad.LaunchpadImageFolder" |
15 | 94 | permission="zope.Public" | 94 | permission="zope.Public" |
17 | 95 | layer="canonical.launchpad.layers.BlueprintsLayer" | 95 | layer="lp.blueprints.publisher.BlueprintsLayer" |
18 | 96 | /> | 96 | /> |
19 | 97 | 97 | ||
20 | 98 | <!-- virtual host: code --> | 98 | <!-- virtual host: code --> |
21 | @@ -113,42 +113,42 @@ | |||
22 | 113 | <browser:defaultView | 113 | <browser:defaultView |
23 | 114 | for="canonical.launchpad.interfaces.ILaunchpadRoot" | 114 | for="canonical.launchpad.interfaces.ILaunchpadRoot" |
24 | 115 | name="translations" | 115 | name="translations" |
26 | 116 | layer="canonical.launchpad.layers.TranslationsLayer" | 116 | layer="lp.translations.publisher.TranslationsLayer" |
27 | 117 | /> | 117 | /> |
28 | 118 | <browser:page | 118 | <browser:page |
29 | 119 | name="" | 119 | name="" |
30 | 120 | for="canonical.launchpad.interfaces.ILaunchpadRoot" | 120 | for="canonical.launchpad.interfaces.ILaunchpadRoot" |
31 | 121 | class="canonical.launchpad.browser.launchpad.LaunchpadImageFolder" | 121 | class="canonical.launchpad.browser.launchpad.LaunchpadImageFolder" |
32 | 122 | permission="zope.Public" | 122 | permission="zope.Public" |
34 | 123 | layer="canonical.launchpad.layers.TranslationsLayer" | 123 | layer="lp.translations.publisher.TranslationsLayer" |
35 | 124 | /> | 124 | /> |
36 | 125 | 125 | ||
37 | 126 | <!-- virtual host: bugs --> | 126 | <!-- virtual host: bugs --> |
38 | 127 | <browser:defaultView | 127 | <browser:defaultView |
39 | 128 | for="canonical.launchpad.interfaces.ILaunchpadRoot" | 128 | for="canonical.launchpad.interfaces.ILaunchpadRoot" |
40 | 129 | name="bugs" | 129 | name="bugs" |
42 | 130 | layer="canonical.launchpad.layers.BugsLayer" | 130 | layer="lp.bugs.publisher.BugsLayer" |
43 | 131 | /> | 131 | /> |
44 | 132 | <browser:page | 132 | <browser:page |
45 | 133 | name="" | 133 | name="" |
46 | 134 | for="canonical.launchpad.interfaces.ILaunchpadRoot" | 134 | for="canonical.launchpad.interfaces.ILaunchpadRoot" |
47 | 135 | class="canonical.launchpad.browser.launchpad.LaunchpadImageFolder" | 135 | class="canonical.launchpad.browser.launchpad.LaunchpadImageFolder" |
48 | 136 | permission="zope.Public" | 136 | permission="zope.Public" |
50 | 137 | layer="canonical.launchpad.layers.BugsLayer" | 137 | layer="lp.bugs.publisher.BugsLayer" |
51 | 138 | /> | 138 | /> |
52 | 139 | 139 | ||
53 | 140 | <!-- virtual host: answers --> | 140 | <!-- virtual host: answers --> |
54 | 141 | <browser:defaultView | 141 | <browser:defaultView |
55 | 142 | for="canonical.launchpad.interfaces.ILaunchpadRoot" | 142 | for="canonical.launchpad.interfaces.ILaunchpadRoot" |
56 | 143 | name="questions" | 143 | name="questions" |
58 | 144 | layer="canonical.launchpad.layers.AnswersLayer" | 144 | layer="lp.answers.publisher.AnswersLayer" |
59 | 145 | /> | 145 | /> |
60 | 146 | <browser:page | 146 | <browser:page |
61 | 147 | name="" | 147 | name="" |
62 | 148 | for="canonical.launchpad.interfaces.ILaunchpadRoot" | 148 | for="canonical.launchpad.interfaces.ILaunchpadRoot" |
63 | 149 | class="canonical.launchpad.browser.launchpad.LaunchpadImageFolder" | 149 | class="canonical.launchpad.browser.launchpad.LaunchpadImageFolder" |
64 | 150 | permission="zope.Public" | 150 | permission="zope.Public" |
66 | 151 | layer="canonical.launchpad.layers.AnswersLayer" | 151 | layer="lp.answers.publisher.AnswersLayer" |
67 | 152 | /> | 152 | /> |
68 | 153 | 153 | ||
69 | 154 | <include package="canonical.widgets" /> | 154 | <include package="canonical.widgets" /> |
70 | 155 | 155 | ||
71 | === modified file 'lib/canonical/launchpad/doc/webapp-publication.txt' | |||
72 | --- lib/canonical/launchpad/doc/webapp-publication.txt 2010-07-20 10:21:01 +0000 | |||
73 | +++ lib/canonical/launchpad/doc/webapp-publication.txt 2010-07-22 20:59:01 +0000 | |||
74 | @@ -356,30 +356,14 @@ | |||
75 | 356 | ProtocolErrorPublication: status=405 | 356 | ProtocolErrorPublication: status=405 |
76 | 357 | Allow: GET HEAD POST | 357 | Allow: GET HEAD POST |
77 | 358 | 358 | ||
78 | 359 | >>> print_request_and_publication('answers.launchpad.dev') | ||
79 | 360 | AnswersBrowserRequest | ||
80 | 361 | AnswersPublication | ||
81 | 362 | |||
82 | 363 | >>> print_request_and_publication('api.launchpad.dev') | 359 | >>> print_request_and_publication('api.launchpad.dev') |
83 | 364 | WebServiceClientRequest | 360 | WebServiceClientRequest |
84 | 365 | WebServicePublication | 361 | WebServicePublication |
85 | 366 | 362 | ||
86 | 367 | >>> print_request_and_publication('blueprints.launchpad.dev') | ||
87 | 368 | BlueprintBrowserRequest | ||
88 | 369 | BlueprintPublication | ||
89 | 370 | |||
90 | 371 | >>> print_request_and_publication('bugs.launchpad.dev') | ||
91 | 372 | BugsBrowserRequest | ||
92 | 373 | BugsPublication | ||
93 | 374 | |||
94 | 375 | >>> print_request_and_publication('feeds.launchpad.dev') | 363 | >>> print_request_and_publication('feeds.launchpad.dev') |
95 | 376 | FeedsBrowserRequest | 364 | FeedsBrowserRequest |
96 | 377 | FeedsPublication | 365 | FeedsPublication |
97 | 378 | 366 | ||
98 | 379 | >>> print_request_and_publication('translations.launchpad.dev') | ||
99 | 380 | TranslationsBrowserRequest | ||
100 | 381 | TranslationsPublication | ||
101 | 382 | |||
102 | 383 | The web service RequestPublicationFactory responds to the six most | 367 | The web service RequestPublicationFactory responds to the six most |
103 | 384 | common HTTP methods, but it will only accept a MIME type of | 368 | common HTTP methods, but it will only accept a MIME type of |
104 | 385 | application/json. | 369 | application/json. |
105 | @@ -404,27 +388,15 @@ | |||
106 | 404 | WebServiceClientRequest | 388 | WebServiceClientRequest |
107 | 405 | WebServicePublication | 389 | WebServicePublication |
108 | 406 | 390 | ||
111 | 407 | When a request for '/api' is made to one of the application virtualhost, | 391 | When a request for '/api' is made to one of the application |
112 | 408 | it is also handled by the web service request and publication: | 392 | virtualhosts, such as the application root, it is also handled by the |
113 | 393 | web service request and publication: | ||
114 | 409 | 394 | ||
115 | 410 | >>> print_request_and_publication( | 395 | >>> print_request_and_publication( |
116 | 411 | ... 'launchpad.dev', method='GET', | 396 | ... 'launchpad.dev', method='GET', |
117 | 412 | ... extra_environment={'PATH_INFO': '/api'}) | 397 | ... extra_environment={'PATH_INFO': '/api'}) |
118 | 413 | WebServiceClientRequest | 398 | WebServiceClientRequest |
119 | 414 | WebServicePublication | 399 | WebServicePublication |
120 | 415 | >>> for subdomain in [ | ||
121 | 416 | ... 'answers', 'blueprints', 'bugs', 'translations']: | ||
122 | 417 | ... print_request_and_publication( | ||
123 | 418 | ... '%s.launchpad.dev' % subdomain, method='GET', | ||
124 | 419 | ... extra_environment={'PATH_INFO': '/api'}) | ||
125 | 420 | WebServiceClientRequest | ||
126 | 421 | WebServicePublication | ||
127 | 422 | WebServiceClientRequest | ||
128 | 423 | WebServicePublication | ||
129 | 424 | WebServiceClientRequest | ||
130 | 425 | WebServicePublication | ||
131 | 426 | WebServiceClientRequest | ||
132 | 427 | WebServicePublication | ||
133 | 428 | 400 | ||
134 | 429 | Requests for '/api' on other hosts like feeds are handled like | 401 | Requests for '/api' on other hosts like feeds are handled like |
135 | 430 | other requests on these hosts: | 402 | other requests on these hosts: |
136 | 431 | 403 | ||
137 | === modified file 'lib/canonical/launchpad/layers.py' | |||
138 | --- lib/canonical/launchpad/layers.py 2010-07-16 15:35:45 +0000 | |||
139 | +++ lib/canonical/launchpad/layers.py 2010-07-22 20:59:01 +0000 | |||
140 | @@ -28,23 +28,6 @@ | |||
141 | 28 | """The `LaunchpadLayer` layer.""" | 28 | """The `LaunchpadLayer` layer.""" |
142 | 29 | 29 | ||
143 | 30 | 30 | ||
144 | 31 | class TranslationsLayer(LaunchpadLayer): | ||
145 | 32 | """The `TranslationsLayer` layer.""" | ||
146 | 33 | |||
147 | 34 | |||
148 | 35 | class BugsLayer(LaunchpadLayer): | ||
149 | 36 | """The `BugsLayer` layer.""" | ||
150 | 37 | |||
151 | 38 | |||
152 | 39 | class BlueprintLayer(LaunchpadLayer): | ||
153 | 40 | """The `BlueprintLayer` layer.""" | ||
154 | 41 | BlueprintsLayer = BlueprintLayer | ||
155 | 42 | |||
156 | 43 | |||
157 | 44 | class AnswersLayer(LaunchpadLayer): | ||
158 | 45 | """The `AnswersLayer` layer.""" | ||
159 | 46 | |||
160 | 47 | |||
161 | 48 | class DebugLayer(Interface): | 31 | class DebugLayer(Interface): |
162 | 49 | """The `DebugLayer` layer. | 32 | """The `DebugLayer` layer. |
163 | 50 | 33 | ||
164 | @@ -83,4 +66,3 @@ | |||
165 | 83 | 66 | ||
166 | 84 | class WebServiceLayer(IWebServiceLayer, LaunchpadLayer): | 67 | class WebServiceLayer(IWebServiceLayer, LaunchpadLayer): |
167 | 85 | """The layer for web service requests.""" | 68 | """The layer for web service requests.""" |
168 | 86 | |||
169 | 87 | 69 | ||
170 | === modified file 'lib/canonical/launchpad/webapp/meta.zcml' | |||
171 | --- lib/canonical/launchpad/webapp/meta.zcml 2010-07-16 15:13:50 +0000 | |||
172 | +++ lib/canonical/launchpad/webapp/meta.zcml 2010-07-22 20:59:01 +0000 | |||
173 | @@ -72,7 +72,7 @@ | |||
174 | 72 | <directive | 72 | <directive |
175 | 73 | namespace="http://namespaces.zope.org/zope" | 73 | namespace="http://namespaces.zope.org/zope" |
176 | 74 | name="publisher" | 74 | name="publisher" |
178 | 75 | schema="canonical.launchpad.webapp.metazcml.ILaunchpadPublicationDirective" | 75 | schema="zope.app.publication.metadirectives.IRequestPublicationDirective" |
179 | 76 | handler="canonical.launchpad.webapp.metazcml.launchpadPublisher" | 76 | handler="canonical.launchpad.webapp.metazcml.launchpadPublisher" |
180 | 77 | /> | 77 | /> |
181 | 78 | 78 | ||
182 | 79 | 79 | ||
183 | === modified file 'lib/canonical/launchpad/webapp/metazcml.py' | |||
184 | --- lib/canonical/launchpad/webapp/metazcml.py 2010-07-16 15:35:45 +0000 | |||
185 | +++ lib/canonical/launchpad/webapp/metazcml.py 2010-07-22 20:59:01 +0000 | |||
186 | @@ -11,7 +11,6 @@ | |||
187 | 11 | from zope.app.file.image import Image | 11 | from zope.app.file.image import Image |
188 | 12 | from zope.app.pagetemplate.engine import TrustedEngine | 12 | from zope.app.pagetemplate.engine import TrustedEngine |
189 | 13 | from zope.app.publication.metaconfigure import publisher | 13 | from zope.app.publication.metaconfigure import publisher |
190 | 14 | from zope.app.publication.metadirectives import IRequestPublicationDirective | ||
191 | 15 | from zope.component import getUtility | 14 | from zope.component import getUtility |
192 | 16 | from zope.component.security import PublicPermission | 15 | from zope.component.security import PublicPermission |
193 | 17 | from zope.component.zcml import adapter, handler, utility, view | 16 | from zope.component.zcml import adapter, handler, utility, view |
194 | @@ -21,7 +20,7 @@ | |||
195 | 21 | from zope.publisher.interfaces.browser import ( | 20 | from zope.publisher.interfaces.browser import ( |
196 | 22 | IBrowserPublisher, IBrowserRequest, IDefaultBrowserLayer) | 21 | IBrowserPublisher, IBrowserRequest, IDefaultBrowserLayer) |
197 | 23 | from zope.publisher.interfaces.xmlrpc import IXMLRPCRequest | 22 | from zope.publisher.interfaces.xmlrpc import IXMLRPCRequest |
199 | 24 | from zope.schema import Int, TextLine | 23 | from zope.schema import TextLine |
200 | 25 | from zope.security.checker import Checker, CheckerPublic | 24 | from zope.security.checker import Checker, CheckerPublic |
201 | 26 | from zope.security.interfaces import IPermission | 25 | from zope.security.interfaces import IPermission |
202 | 27 | from zope.security.permission import Permission | 26 | from zope.security.permission import Permission |
203 | @@ -35,7 +34,6 @@ | |||
204 | 35 | from z3c.ptcompat.zcml import page_directive as original_page | 34 | from z3c.ptcompat.zcml import page_directive as original_page |
205 | 36 | from z3c.ptcompat.zcml import pages_directive as original_pages | 35 | from z3c.ptcompat.zcml import pages_directive as original_pages |
206 | 37 | 36 | ||
207 | 38 | from canonical.config import config | ||
208 | 39 | from canonical.launchpad.layers import FeedsLayer | 37 | from canonical.launchpad.layers import FeedsLayer |
209 | 40 | from canonical.launchpad.webapp.interfaces import ( | 38 | from canonical.launchpad.webapp.interfaces import ( |
210 | 41 | IApplicationMenu, IAuthorization, ICanonicalUrlData, IContextMenu, | 39 | IApplicationMenu, IAuthorization, ICanonicalUrlData, IContextMenu, |
211 | @@ -48,10 +46,12 @@ | |||
212 | 48 | 46 | ||
213 | 49 | module = GlobalObject(title=u'module', required=True) | 47 | module = GlobalObject(title=u'module', required=True) |
214 | 50 | 48 | ||
215 | 49 | |||
216 | 51 | def _isAuthorization(module_member): | 50 | def _isAuthorization(module_member): |
217 | 52 | return (type(module_member) is type and | 51 | return (type(module_member) is type and |
218 | 53 | IAuthorization.implementedBy(module_member)) | 52 | IAuthorization.implementedBy(module_member)) |
219 | 54 | 53 | ||
220 | 54 | |||
221 | 55 | def authorizations(_context, module): | 55 | def authorizations(_context, module): |
222 | 56 | if not inspect.ismodule(module): | 56 | if not inspect.ismodule(module): |
223 | 57 | raise TypeError("module attribute must be a module: %s, %s" % | 57 | raise TypeError("module attribute must be a module: %s, %s" % |
224 | @@ -100,6 +100,7 @@ | |||
225 | 100 | raise RuntimeError( | 100 | raise RuntimeError( |
226 | 101 | "unrecognised discriminator name", name) | 101 | "unrecognised discriminator name", name) |
227 | 102 | 102 | ||
228 | 103 | |||
229 | 103 | class SecuredUtilityDirective: | 104 | class SecuredUtilityDirective: |
230 | 104 | 105 | ||
231 | 105 | def __init__(self, _context, provides, class_=None, component=None, | 106 | def __init__(self, _context, provides, class_=None, component=None, |
232 | @@ -131,11 +132,10 @@ | |||
233 | 131 | # of the zcml. | 132 | # of the zcml. |
234 | 132 | checker = Checker( | 133 | checker = Checker( |
235 | 133 | self.permission_collector.get_permissions, | 134 | self.permission_collector.get_permissions, |
238 | 134 | self.permission_collector.set_permissions | 135 | self.permission_collector.set_permissions) |
237 | 135 | ) | ||
239 | 136 | component = ProxyFactory(self.component, checker=checker) | 136 | component = ProxyFactory(self.component, checker=checker) |
242 | 137 | utility(self._context, self.provides, component=component, | 137 | utility( |
243 | 138 | name=self.name) | 138 | self._context, self.provides, component=component, name=self.name) |
244 | 139 | return () | 139 | return () |
245 | 140 | 140 | ||
246 | 141 | 141 | ||
247 | @@ -144,29 +144,24 @@ | |||
248 | 144 | 144 | ||
249 | 145 | for_ = GlobalObject( | 145 | for_ = GlobalObject( |
250 | 146 | title=u"Specification of the object that has this canonical url", | 146 | title=u"Specification of the object that has this canonical url", |
253 | 147 | required=True | 147 | required=True) |
252 | 148 | ) | ||
254 | 149 | 148 | ||
255 | 150 | urldata = GlobalObject( | 149 | urldata = GlobalObject( |
256 | 151 | title=u"Adapter to ICanonicalUrlData for this object.", | 150 | title=u"Adapter to ICanonicalUrlData for this object.", |
259 | 152 | required=False | 151 | required=False) |
258 | 153 | ) | ||
260 | 154 | 152 | ||
261 | 155 | path_expression = TextLine( | 153 | path_expression = TextLine( |
262 | 156 | title=u"TALES expression that evaluates to the path" | 154 | title=u"TALES expression that evaluates to the path" |
263 | 157 | " relative to the parent object.", | 155 | " relative to the parent object.", |
266 | 158 | required=False | 156 | required=False) |
265 | 159 | ) | ||
267 | 160 | 157 | ||
268 | 161 | attribute_to_parent = PythonIdentifier( | 158 | attribute_to_parent = PythonIdentifier( |
269 | 162 | title=u"Name of the attribute that gets you to the parent object", | 159 | title=u"Name of the attribute that gets you to the parent object", |
272 | 163 | required=False | 160 | required=False) |
271 | 164 | ) | ||
273 | 165 | 161 | ||
274 | 166 | parent_utility = GlobalObject( | 162 | parent_utility = GlobalObject( |
275 | 167 | title=u"Interface of the utility that is the parent of the object", | 163 | title=u"Interface of the utility that is the parent of the object", |
278 | 168 | required=False | 164 | required=False) |
277 | 169 | ) | ||
279 | 170 | 165 | ||
280 | 171 | rootsite = PythonIdentifier( | 166 | rootsite = PythonIdentifier( |
281 | 172 | title=u"Name of the site this URL has as its root." | 167 | title=u"Name of the site this URL has as its root." |
282 | @@ -182,14 +177,12 @@ | |||
283 | 182 | generic mechanism, what that 'something' is isn't important. | 177 | generic mechanism, what that 'something' is isn't important. |
284 | 183 | """ | 178 | """ |
285 | 184 | module = GlobalObject( | 179 | module = GlobalObject( |
288 | 185 | title=u"Module in which the classes are found." | 180 | title=u"Module in which the classes are found.") |
287 | 186 | ) | ||
289 | 187 | 181 | ||
290 | 188 | classes = Tokens( | 182 | classes = Tokens( |
291 | 189 | value_type=PythonIdentifier(), | 183 | value_type=PythonIdentifier(), |
292 | 190 | title=u"Space separated list of classes to register.", | 184 | title=u"Space separated list of classes to register.", |
295 | 191 | required=True | 185 | required=True) |
294 | 192 | ) | ||
296 | 193 | 186 | ||
297 | 194 | 187 | ||
298 | 195 | class IMenusDirective(IGlueDirective): | 188 | class IMenusDirective(IGlueDirective): |
299 | @@ -208,13 +201,11 @@ | |||
300 | 208 | 201 | ||
301 | 209 | for_ = GlobalObject( | 202 | for_ = GlobalObject( |
302 | 210 | title=u"Specification of the object that has this favicon", | 203 | title=u"Specification of the object that has this favicon", |
305 | 211 | required=True | 204 | required=True) |
304 | 212 | ) | ||
306 | 213 | 205 | ||
307 | 214 | file = Path( | 206 | file = Path( |
308 | 215 | title=u"Path to the image file", | 207 | title=u"Path to the image file", |
311 | 216 | required=True | 208 | required=True) |
310 | 217 | ) | ||
312 | 218 | 209 | ||
313 | 219 | 210 | ||
314 | 220 | def menus(_context, module, classes): | 211 | def menus(_context, module, classes): |
315 | @@ -307,6 +298,7 @@ | |||
316 | 307 | class InterfaceInstanceDispatcher: | 298 | class InterfaceInstanceDispatcher: |
317 | 308 | """Dispatch getitem on names that appear in the interface to the instance. | 299 | """Dispatch getitem on names that appear in the interface to the instance. |
318 | 309 | """ | 300 | """ |
319 | 301 | |||
320 | 310 | def __init__(self, interface, instance): | 302 | def __init__(self, interface, instance): |
321 | 311 | self.interface = interface | 303 | self.interface = interface |
322 | 312 | self.instance = instance | 304 | self.instance = instance |
323 | @@ -379,6 +371,7 @@ | |||
324 | 379 | _for = for_ | 371 | _for = for_ |
325 | 380 | _compiled_path_expression = compiled_path_expression | 372 | _compiled_path_expression = compiled_path_expression |
326 | 381 | rootsite = rootsite_ | 373 | rootsite = rootsite_ |
327 | 374 | |||
328 | 382 | @property | 375 | @property |
329 | 383 | def inside(self): | 376 | def inside(self): |
330 | 384 | return getattr(self.context, attribute_to_parent) | 377 | return getattr(self.context, attribute_to_parent) |
331 | @@ -387,6 +380,7 @@ | |||
332 | 387 | _for = for_ | 380 | _for = for_ |
333 | 388 | _compiled_path_expression = compiled_path_expression | 381 | _compiled_path_expression = compiled_path_expression |
334 | 389 | rootsite = rootsite_ | 382 | rootsite = rootsite_ |
335 | 383 | |||
336 | 390 | @property | 384 | @property |
337 | 391 | def inside(self): | 385 | def inside(self): |
338 | 392 | return getUtility(parent_utility) | 386 | return getUtility(parent_utility) |
339 | @@ -397,17 +391,18 @@ | |||
340 | 397 | 391 | ||
341 | 398 | 392 | ||
342 | 399 | class FaviconRendererBase: | 393 | class FaviconRendererBase: |
343 | 400 | |||
344 | 401 | # subclasses must provide a 'fileobj' member that has 'contentType' | 394 | # subclasses must provide a 'fileobj' member that has 'contentType' |
345 | 402 | # and 'data' attributes. | 395 | # and 'data' attributes. |
346 | 403 | 396 | ||
347 | 404 | def __call__(self): | 397 | def __call__(self): |
350 | 405 | self.request.response.setHeader('Content-type', | 398 | self.request.response.setHeader( |
351 | 406 | self.file.contentType) | 399 | 'Content-type', self.file.contentType) |
352 | 407 | return self.file.data | 400 | return self.file.data |
353 | 408 | 401 | ||
354 | 402 | |||
355 | 409 | def favicon(_context, for_, file): | 403 | def favicon(_context, for_, file): |
356 | 410 | fileobj = Image(open(file, 'rb').read()) | 404 | fileobj = Image(open(file, 'rb').read()) |
357 | 405 | |||
358 | 411 | class Favicon(FaviconRendererBase): | 406 | class Favicon(FaviconRendererBase): |
359 | 412 | file = fileobj | 407 | file = fileobj |
360 | 413 | 408 | ||
361 | @@ -434,8 +429,7 @@ | |||
362 | 434 | layer=IDefaultBrowserLayer, template=None, class_=None, | 429 | layer=IDefaultBrowserLayer, template=None, class_=None, |
363 | 435 | allowed_interface=None, allowed_attributes=None, | 430 | allowed_interface=None, allowed_attributes=None, |
364 | 436 | attribute='__call__', menu=None, title=None, | 431 | attribute='__call__', menu=None, title=None, |
367 | 437 | facet=None | 432 | facet=None): |
366 | 438 | ): | ||
368 | 439 | """Like the standard 'page' directive, but with an added 'facet' optional | 433 | """Like the standard 'page' directive, but with an added 'facet' optional |
369 | 440 | argument. | 434 | argument. |
370 | 441 | 435 | ||
371 | @@ -503,7 +497,7 @@ | |||
372 | 503 | 497 | ||
373 | 504 | for_ = GlobalObject( | 498 | for_ = GlobalObject( |
374 | 505 | title=u"Specification of the object that has the renamed page", | 499 | title=u"Specification of the object that has the renamed page", |
376 | 506 | required=True ) | 500 | required=True) |
377 | 507 | 501 | ||
378 | 508 | layer = GlobalInterface( | 502 | layer = GlobalInterface( |
379 | 509 | title=u"The layer the renamed page is in.", | 503 | title=u"The layer the renamed page is in.", |
380 | @@ -532,6 +526,7 @@ | |||
381 | 532 | def renamed_page(_context, for_, name, new_name, layer=IDefaultBrowserLayer, | 526 | def renamed_page(_context, for_, name, new_name, layer=IDefaultBrowserLayer, |
382 | 533 | rootsite=None): | 527 | rootsite=None): |
383 | 534 | """Will provide a `RedirectView` that will redirect to the new_name.""" | 528 | """Will provide a `RedirectView` that will redirect to the new_name.""" |
384 | 529 | |||
385 | 535 | def renamed_factory(context, request): | 530 | def renamed_factory(context, request): |
386 | 536 | return RenamedView( | 531 | return RenamedView( |
387 | 537 | context, request, new_name=new_name, rootsite=rootsite) | 532 | context, request, new_name=new_name, rootsite=rootsite) |
388 | @@ -656,15 +651,14 @@ | |||
389 | 656 | utility(_context, ILaunchpadPermission, permission, name=id) | 651 | utility(_context, ILaunchpadPermission, permission, name=id) |
390 | 657 | 652 | ||
391 | 658 | 653 | ||
392 | 659 | class ILaunchpadPublicationDirective(IRequestPublicationDirective): | ||
393 | 660 | |||
394 | 661 | priorty = Int(required=False) | ||
395 | 662 | |||
396 | 663 | _arbitrary_priority = 12 | 654 | _arbitrary_priority = 12 |
397 | 664 | 655 | ||
398 | 665 | 656 | ||
399 | 666 | def launchpadPublisher(_context, name, factory, methods=['*'], | 657 | def launchpadPublisher(_context, name, factory, methods=['*'], |
400 | 667 | mimetypes=['*'], priority=None): | 658 | mimetypes=['*'], priority=None): |
401 | 659 | # This overrides zope's definition of the <publisher> directive to supply | ||
402 | 660 | # an arbitrary unique priority if none is explicitly supplied -- we don't | ||
403 | 661 | # care about the priority in Launchpad but it needs to be unique. | ||
404 | 668 | global _arbitrary_priority | 662 | global _arbitrary_priority |
405 | 669 | if priority is None: | 663 | if priority is None: |
406 | 670 | _arbitrary_priority += 1 | 664 | _arbitrary_priority += 1 |
407 | 671 | 665 | ||
408 | === modified file 'lib/canonical/launchpad/webapp/servers.py' | |||
409 | --- lib/canonical/launchpad/webapp/servers.py 2010-07-22 01:48:51 +0000 | |||
410 | +++ lib/canonical/launchpad/webapp/servers.py 2010-07-22 20:59:01 +0000 | |||
411 | @@ -352,7 +352,7 @@ | |||
412 | 352 | else: | 352 | else: |
413 | 353 | request_factory = ProtocolErrorRequest | 353 | request_factory = ProtocolErrorRequest |
414 | 354 | publication_factory = ProtocolErrorPublicationFactory( | 354 | publication_factory = ProtocolErrorPublicationFactory( |
416 | 355 | 405, headers={'Allow':" ".join(self.methods)}) | 355 | 405, headers={'Allow': " ".join(self.methods)}) |
417 | 356 | factories = (request_factory, publication_factory) | 356 | factories = (request_factory, publication_factory) |
418 | 357 | 357 | ||
419 | 358 | return factories | 358 | return factories |
420 | @@ -614,6 +614,7 @@ | |||
421 | 614 | """See `ISynchronizer`.""" | 614 | """See `ISynchronizer`.""" |
422 | 615 | pass | 615 | pass |
423 | 616 | 616 | ||
424 | 617 | |||
425 | 617 | class BrowserFormNG: | 618 | class BrowserFormNG: |
426 | 618 | """Wrapper that provides IBrowserFormNG around a regular form dict.""" | 619 | """Wrapper that provides IBrowserFormNG around a regular form dict.""" |
427 | 619 | 620 | ||
428 | @@ -680,6 +681,7 @@ | |||
429 | 680 | def install(cls): | 681 | def install(cls): |
430 | 681 | """Install the monkey patch.""" | 682 | """Install the monkey patch.""" |
431 | 682 | assert not cls.installed, "Monkey patch is already installed." | 683 | assert not cls.installed, "Monkey patch is already installed." |
432 | 684 | |||
433 | 683 | def _getFormInput_single(self): | 685 | def _getFormInput_single(self): |
434 | 684 | """Return the submitted form value. | 686 | """Return the submitted form value. |
435 | 685 | 687 | ||
436 | @@ -975,9 +977,7 @@ | |||
437 | 975 | userid, | 977 | userid, |
438 | 976 | pageid, | 978 | pageid, |
439 | 977 | referer, | 979 | referer, |
443 | 978 | user_agent | 980 | user_agent)) |
441 | 979 | ) | ||
442 | 980 | ) | ||
444 | 981 | 981 | ||
445 | 982 | 982 | ||
446 | 983 | http = wsgi.ServerType( | 983 | http = wsgi.ServerType( |
447 | @@ -1015,52 +1015,6 @@ | |||
448 | 1015 | class MainLaunchpadPublication(LaunchpadBrowserPublication): | 1015 | class MainLaunchpadPublication(LaunchpadBrowserPublication): |
449 | 1016 | """The publication used for the main Launchpad site.""" | 1016 | """The publication used for the main Launchpad site.""" |
450 | 1017 | 1017 | ||
451 | 1018 | # ---- blueprint | ||
452 | 1019 | |||
453 | 1020 | class BlueprintBrowserRequest(LaunchpadBrowserRequest): | ||
454 | 1021 | implements(canonical.launchpad.layers.BlueprintLayer) | ||
455 | 1022 | |||
456 | 1023 | class BlueprintPublication(LaunchpadBrowserPublication): | ||
457 | 1024 | """The publication used for the Blueprint site.""" | ||
458 | 1025 | |||
459 | 1026 | # ---- translations | ||
460 | 1027 | |||
461 | 1028 | class TranslationsPublication(LaunchpadBrowserPublication): | ||
462 | 1029 | """The publication used for the Translations site.""" | ||
463 | 1030 | |||
464 | 1031 | class TranslationsBrowserRequest(LaunchpadBrowserRequest): | ||
465 | 1032 | implements(canonical.launchpad.layers.TranslationsLayer) | ||
466 | 1033 | |||
467 | 1034 | def __init__(self, body_instream, environ, response=None): | ||
468 | 1035 | super(TranslationsBrowserRequest, self).__init__( | ||
469 | 1036 | body_instream, environ, response) | ||
470 | 1037 | # Some of the responses from translations vary based on language. | ||
471 | 1038 | self.response.setHeader( | ||
472 | 1039 | 'Vary', 'Cookie, Authorization, Accept-Language') | ||
473 | 1040 | |||
474 | 1041 | # ---- bugs | ||
475 | 1042 | |||
476 | 1043 | class BugsPublication(LaunchpadBrowserPublication): | ||
477 | 1044 | """The publication used for the Bugs site.""" | ||
478 | 1045 | |||
479 | 1046 | class BugsBrowserRequest(LaunchpadBrowserRequest): | ||
480 | 1047 | implements(canonical.launchpad.layers.BugsLayer) | ||
481 | 1048 | |||
482 | 1049 | # ---- answers | ||
483 | 1050 | |||
484 | 1051 | class AnswersPublication(LaunchpadBrowserPublication): | ||
485 | 1052 | """The publication used for the Answers site.""" | ||
486 | 1053 | |||
487 | 1054 | class AnswersBrowserRequest(LaunchpadBrowserRequest): | ||
488 | 1055 | implements(canonical.launchpad.layers.AnswersLayer) | ||
489 | 1056 | |||
490 | 1057 | def __init__(self, body_instream, environ, response=None): | ||
491 | 1058 | super(AnswersBrowserRequest, self).__init__( | ||
492 | 1059 | body_instream, environ, response) | ||
493 | 1060 | # Many of the responses from Answers vary based on language. | ||
494 | 1061 | self.response.setHeader( | ||
495 | 1062 | 'Vary', 'Cookie, Authorization, Accept-Language') | ||
496 | 1063 | |||
497 | 1064 | 1018 | ||
498 | 1065 | class AccountPrincipalMixin: | 1019 | class AccountPrincipalMixin: |
499 | 1066 | """Mixin for publication that works with person-less accounts.""" | 1020 | """Mixin for publication that works with person-less accounts.""" |
500 | @@ -1326,10 +1280,10 @@ | |||
501 | 1326 | 1280 | ||
502 | 1327 | class PublicXMLRPCPublication(LaunchpadBrowserPublication): | 1281 | class PublicXMLRPCPublication(LaunchpadBrowserPublication): |
503 | 1328 | """The publication used for public XML-RPC requests.""" | 1282 | """The publication used for public XML-RPC requests.""" |
504 | 1283 | |||
505 | 1329 | def handleException(self, object, request, exc_info, retry_allowed=True): | 1284 | def handleException(self, object, request, exc_info, retry_allowed=True): |
506 | 1330 | LaunchpadBrowserPublication.handleException( | 1285 | LaunchpadBrowserPublication.handleException( |
509 | 1331 | self, object, request, exc_info, retry_allowed | 1286 | self, object, request, exc_info, retry_allowed) |
508 | 1332 | ) | ||
510 | 1333 | OpStats.stats['xml-rpc faults'] += 1 | 1287 | OpStats.stats['xml-rpc faults'] += 1 |
511 | 1334 | 1288 | ||
512 | 1335 | def endRequest(self, request, object): | 1289 | def endRequest(self, request, object): |
513 | @@ -1475,16 +1429,11 @@ | |||
514 | 1475 | factories = [ | 1429 | factories = [ |
515 | 1476 | VWSHRP('mainsite', LaunchpadBrowserRequest, MainLaunchpadPublication, | 1430 | VWSHRP('mainsite', LaunchpadBrowserRequest, MainLaunchpadPublication, |
516 | 1477 | handle_default_host=True), | 1431 | handle_default_host=True), |
517 | 1478 | VWSHRP('blueprints', BlueprintBrowserRequest, BlueprintPublication), | ||
518 | 1479 | VWSHRP('translations', TranslationsBrowserRequest, | ||
519 | 1480 | TranslationsPublication), | ||
520 | 1481 | VWSHRP('bugs', BugsBrowserRequest, BugsPublication), | ||
521 | 1482 | VWSHRP('answers', AnswersBrowserRequest, AnswersPublication), | ||
522 | 1483 | VHRP('feeds', FeedsBrowserRequest, FeedsPublication), | 1432 | VHRP('feeds', FeedsBrowserRequest, FeedsPublication), |
523 | 1484 | WebServiceRequestPublicationFactory( | 1433 | WebServiceRequestPublicationFactory( |
524 | 1485 | 'api', WebServiceClientRequest, WebServicePublication), | 1434 | 'api', WebServiceClientRequest, WebServicePublication), |
525 | 1486 | XMLRPCRequestPublicationFactory( | 1435 | XMLRPCRequestPublicationFactory( |
527 | 1487 | 'xmlrpc', PublicXMLRPCRequest, PublicXMLRPCPublication) | 1436 | 'xmlrpc', PublicXMLRPCRequest, PublicXMLRPCPublication), |
528 | 1488 | ] | 1437 | ] |
529 | 1489 | 1438 | ||
530 | 1490 | if config.launchpad.enable_test_openid_provider: | 1439 | if config.launchpad.enable_test_openid_provider: |
531 | 1491 | 1440 | ||
532 | === modified file 'lib/canonical/launchpad/webapp/tests/test_servers.py' | |||
533 | --- lib/canonical/launchpad/webapp/tests/test_servers.py 2010-07-14 14:11:15 +0000 | |||
534 | +++ lib/canonical/launchpad/webapp/tests/test_servers.py 2010-07-22 20:59:01 +0000 | |||
535 | @@ -21,9 +21,8 @@ | |||
536 | 21 | from lp.testing import TestCase | 21 | from lp.testing import TestCase |
537 | 22 | 22 | ||
538 | 23 | from canonical.launchpad.webapp.servers import ( | 23 | from canonical.launchpad.webapp.servers import ( |
542 | 24 | AnswersBrowserRequest, ApplicationServerSettingRequestFactory, | 24 | ApplicationServerSettingRequestFactory, LaunchpadBrowserRequest, |
543 | 25 | BugsBrowserRequest, BugsPublication, LaunchpadBrowserRequest, | 25 | VHostWebServiceRequestPublicationFactory, |
541 | 26 | TranslationsBrowserRequest, VHostWebServiceRequestPublicationFactory, | ||
544 | 27 | VirtualHostRequestPublicationFactory, WebServiceRequestPublicationFactory, | 26 | VirtualHostRequestPublicationFactory, WebServiceRequestPublicationFactory, |
545 | 28 | WebServiceClientRequest, WebServicePublication, WebServiceTestRequest) | 27 | WebServiceClientRequest, WebServicePublication, WebServiceTestRequest) |
546 | 29 | 28 | ||
547 | @@ -99,35 +98,42 @@ | |||
548 | 99 | 98 | ||
549 | 100 | class TestVhostWebserviceFactory(WebServiceTestCase): | 99 | class TestVhostWebserviceFactory(WebServiceTestCase): |
550 | 101 | 100 | ||
551 | 101 | class VHostTestBrowserRequest(LaunchpadBrowserRequest): | ||
552 | 102 | pass | ||
553 | 103 | |||
554 | 104 | class VHostTestPublication(LaunchpadBrowserRequest): | ||
555 | 105 | pass | ||
556 | 106 | |||
557 | 102 | def setUp(self): | 107 | def setUp(self): |
558 | 103 | super(TestVhostWebserviceFactory, self).setUp() | 108 | super(TestVhostWebserviceFactory, self).setUp() |
559 | 109 | # XXX We have to use a real hostname. | ||
560 | 104 | self.factory = VHostWebServiceRequestPublicationFactory( | 110 | self.factory = VHostWebServiceRequestPublicationFactory( |
562 | 105 | 'bugs', BugsBrowserRequest, BugsPublication) | 111 | 'bugs', self.VHostTestBrowserRequest, self.VHostTestPublication) |
563 | 106 | 112 | ||
564 | 107 | def wsgi_env(self, path, method='GET'): | 113 | def wsgi_env(self, path, method='GET'): |
565 | 108 | """Simulate a WSGI application environment.""" | 114 | """Simulate a WSGI application environment.""" |
566 | 109 | return { | 115 | return { |
567 | 110 | 'PATH_INFO': path, | 116 | 'PATH_INFO': path, |
568 | 111 | 'HTTP_HOST': 'bugs.launchpad.dev', | 117 | 'HTTP_HOST': 'bugs.launchpad.dev', |
570 | 112 | 'REQUEST_METHOD': method | 118 | 'REQUEST_METHOD': method, |
571 | 113 | } | 119 | } |
572 | 114 | 120 | ||
573 | 115 | @property | 121 | @property |
576 | 116 | def working_api_path(self): | 122 | def api_path(self): |
577 | 117 | """A path to the webservice API that should work every time.""" | 123 | """Requests to this path should be treated as webservice requests.""" |
578 | 118 | return '/' + getUtility(IWebServiceConfiguration).path_override | 124 | return '/' + getUtility(IWebServiceConfiguration).path_override |
579 | 119 | 125 | ||
580 | 120 | @property | 126 | @property |
583 | 121 | def failing_api_path(self): | 127 | def non_api_path(self): |
584 | 122 | """A path that should not work with the webservice API.""" | 128 | """Requests to this path should not be treated as webservice requests. |
585 | 129 | """ | ||
586 | 123 | return '/foo' | 130 | return '/foo' |
587 | 124 | 131 | ||
588 | 125 | def test_factory_produces_webservice_objects(self): | 132 | def test_factory_produces_webservice_objects(self): |
589 | 126 | """The factory should produce WebService request and publication | 133 | """The factory should produce WebService request and publication |
590 | 127 | objects for requests to the /api root URL. | 134 | objects for requests to the /api root URL. |
591 | 128 | """ | 135 | """ |
594 | 129 | env = self.wsgi_env( | 136 | env = self.wsgi_env(self.api_path) |
593 | 130 | '/' + getUtility(IWebServiceConfiguration).path_override) | ||
595 | 131 | 137 | ||
596 | 132 | # Necessary preamble and sanity check. We need to call | 138 | # Necessary preamble and sanity check. We need to call |
597 | 133 | # the factory's canHandle() method with an appropriate | 139 | # the factory's canHandle() method with an appropriate |
598 | @@ -153,7 +159,7 @@ | |||
599 | 153 | specified in it's constructor if the request is not bound for the | 159 | specified in it's constructor if the request is not bound for the |
600 | 154 | web service. | 160 | web service. |
601 | 155 | """ | 161 | """ |
603 | 156 | env = self.wsgi_env('/foo') | 162 | env = self.wsgi_env(self.non_api_path) |
604 | 157 | self.assert_(self.factory.canHandle(env), | 163 | self.assert_(self.factory.canHandle(env), |
605 | 158 | "Sanity check: The factory should be able to handle requests.") | 164 | "Sanity check: The factory should be able to handle requests.") |
606 | 159 | 165 | ||
607 | @@ -162,12 +168,12 @@ | |||
608 | 162 | # We need to unwrap the real request factory. | 168 | # We need to unwrap the real request factory. |
609 | 163 | request_factory = wrapped_factory.requestfactory | 169 | request_factory = wrapped_factory.requestfactory |
610 | 164 | 170 | ||
613 | 165 | self.assertEqual(request_factory, BugsBrowserRequest, | 171 | self.assertEqual(request_factory, self.VHostTestBrowserRequest, |
614 | 166 | "Requests to normal paths should return a Bugs " | 172 | "Requests to normal paths should return a VHostTest " |
615 | 167 | "request object.") | 173 | "request object.") |
616 | 168 | self.assertEqual( | 174 | self.assertEqual( |
619 | 169 | publication_factory, BugsPublication, | 175 | publication_factory, self.VHostTestPublication, |
620 | 170 | "Requests to normal paths should return a Bugs " | 176 | "Requests to normal paths should return a VHostTest " |
621 | 171 | "publication object.") | 177 | "publication object.") |
622 | 172 | 178 | ||
623 | 173 | def test_factory_processes_webservice_http_methods(self): | 179 | def test_factory_processes_webservice_http_methods(self): |
624 | @@ -177,7 +183,7 @@ | |||
625 | 177 | allowed_methods = WebServiceRequestPublicationFactory.default_methods | 183 | allowed_methods = WebServiceRequestPublicationFactory.default_methods |
626 | 178 | 184 | ||
627 | 179 | for method in allowed_methods: | 185 | for method in allowed_methods: |
629 | 180 | env = self.wsgi_env(self.working_api_path, method) | 186 | env = self.wsgi_env(self.api_path, method) |
630 | 181 | self.assert_(self.factory.canHandle(env), | 187 | self.assert_(self.factory.canHandle(env), |
631 | 182 | "Sanity check") | 188 | "Sanity check") |
632 | 183 | # Returns a tuple of (request_factory, publication_factory). | 189 | # Returns a tuple of (request_factory, publication_factory). |
633 | @@ -198,7 +204,7 @@ | |||
634 | 198 | denied_methods = set(ws_methods) - set(vhost_methods) | 204 | denied_methods = set(ws_methods) - set(vhost_methods) |
635 | 199 | 205 | ||
636 | 200 | for method in denied_methods: | 206 | for method in denied_methods: |
638 | 201 | env = self.wsgi_env(self.failing_api_path, method) | 207 | env = self.wsgi_env(self.non_api_path, method) |
639 | 202 | self.assert_(self.factory.canHandle(env), | 208 | self.assert_(self.factory.canHandle(env), |
640 | 203 | "Sanity check") | 209 | "Sanity check") |
641 | 204 | # Returns a tuple of (request_factory, publication_factory). | 210 | # Returns a tuple of (request_factory, publication_factory). |
642 | @@ -221,9 +227,6 @@ | |||
643 | 221 | self.assert_( | 227 | self.assert_( |
644 | 222 | self.factory.isWebServicePath('/api'), | 228 | self.factory.isWebServicePath('/api'), |
645 | 223 | "The factory should handle URLs that start with /api.") | 229 | "The factory should handle URLs that start with /api.") |
646 | 224 | self.assert_( | ||
647 | 225 | self.factory.isWebServicePath('/api/'), | ||
648 | 226 | "The factory should handle URLs that start with /api.") | ||
649 | 227 | 230 | ||
650 | 228 | self.assert_( | 231 | self.assert_( |
651 | 229 | self.factory.isWebServicePath('/api/foo'), | 232 | self.factory.isWebServicePath('/api/foo'), |
652 | @@ -263,8 +266,10 @@ | |||
653 | 263 | implements(IGenericCollection) | 266 | implements(IGenericCollection) |
654 | 264 | 267 | ||
655 | 265 | class MyRootResource(RootResource): | 268 | class MyRootResource(RootResource): |
656 | 269 | |||
657 | 266 | def _build_top_level_objects(self): | 270 | def _build_top_level_objects(self): |
659 | 267 | return ({'foo' : (IGenericEntry, GenericCollection())}, {}) | 271 | return ({'foo': (IGenericEntry, GenericCollection())}, {}) |
660 | 272 | |||
661 | 268 | getGlobalSiteManager().registerUtility( | 273 | getGlobalSiteManager().registerUtility( |
662 | 269 | MyRootResource(), IServiceRootResource) | 274 | MyRootResource(), IServiceRootResource) |
663 | 270 | 275 | ||
664 | @@ -385,26 +390,6 @@ | |||
665 | 385 | self.assertEquals(self.request.getNearest(IThing), (None, None)) | 390 | self.assertEquals(self.request.getNearest(IThing), (None, None)) |
666 | 386 | 391 | ||
667 | 387 | 392 | ||
668 | 388 | class TestAnswersBrowserRequest(TestCase): | ||
669 | 389 | """Tests for the Answers request class.""" | ||
670 | 390 | |||
671 | 391 | def test_response_should_vary_based_on_language(self): | ||
672 | 392 | request = AnswersBrowserRequest(StringIO.StringIO(''), {}) | ||
673 | 393 | self.assertEquals( | ||
674 | 394 | request.response.getHeader('Vary'), | ||
675 | 395 | 'Cookie, Authorization, Accept-Language') | ||
676 | 396 | |||
677 | 397 | |||
678 | 398 | class TestTranslationsBrowserRequest(TestCase): | ||
679 | 399 | """Tests for the Translations request class.""" | ||
680 | 400 | |||
681 | 401 | def test_response_should_vary_based_on_language(self): | ||
682 | 402 | request = TranslationsBrowserRequest(StringIO.StringIO(''), {}) | ||
683 | 403 | self.assertEquals( | ||
684 | 404 | request.response.getHeader('Vary'), | ||
685 | 405 | 'Cookie, Authorization, Accept-Language') | ||
686 | 406 | |||
687 | 407 | |||
688 | 408 | class TestLaunchpadBrowserRequest(TestCase): | 393 | class TestLaunchpadBrowserRequest(TestCase): |
689 | 409 | 394 | ||
690 | 410 | def prepareRequest(self, form): | 395 | def prepareRequest(self, form): |
691 | 411 | 396 | ||
692 | === modified file 'lib/canonical/launchpad/zcml/marketing.zcml' | |||
693 | --- lib/canonical/launchpad/zcml/marketing.zcml 2010-07-16 15:40:14 +0000 | |||
694 | +++ lib/canonical/launchpad/zcml/marketing.zcml 2010-07-22 20:59:01 +0000 | |||
695 | @@ -26,14 +26,14 @@ | |||
696 | 26 | <!-- Marketing material for Answers. --> | 26 | <!-- Marketing material for Answers. --> |
697 | 27 | <browser:renamed-page | 27 | <browser:renamed-page |
698 | 28 | for="canonical.launchpad.webapp.interfaces.ILaunchpadApplication" | 28 | for="canonical.launchpad.webapp.interfaces.ILaunchpadApplication" |
700 | 29 | layer="canonical.launchpad.layers.AnswersLayer" | 29 | layer="lp.answers.publisher.AnswersLayer" |
701 | 30 | name="+about" | 30 | name="+about" |
702 | 31 | new_name="+tour/community-support" | 31 | new_name="+tour/community-support" |
703 | 32 | rootsite="mainsite" | 32 | rootsite="mainsite" |
704 | 33 | /> | 33 | /> |
705 | 34 | <browser:renamed-page | 34 | <browser:renamed-page |
706 | 35 | for="canonical.launchpad.webapp.interfaces.ILaunchpadApplication" | 35 | for="canonical.launchpad.webapp.interfaces.ILaunchpadApplication" |
708 | 36 | layer="canonical.launchpad.layers.AnswersLayer" | 36 | layer="lp.answers.publisher.AnswersLayer" |
709 | 37 | name="+faq" | 37 | name="+faq" |
710 | 38 | new_name="+tour/community-support" | 38 | new_name="+tour/community-support" |
711 | 39 | rootsite="mainsite" | 39 | rootsite="mainsite" |
712 | @@ -43,20 +43,20 @@ | |||
713 | 43 | new_name="+tour/community-support" | 43 | new_name="+tour/community-support" |
714 | 44 | rootsite="mainsite" | 44 | rootsite="mainsite" |
715 | 45 | for="canonical.launchpad.webapp.interfaces.ILaunchpadApplication" | 45 | for="canonical.launchpad.webapp.interfaces.ILaunchpadApplication" |
717 | 46 | layer="canonical.launchpad.layers.AnswersLayer" | 46 | layer="lp.answers.publisher.AnswersLayer" |
718 | 47 | /> | 47 | /> |
719 | 48 | 48 | ||
720 | 49 | <!-- Marketing material for Blueprints. --> | 49 | <!-- Marketing material for Blueprints. --> |
721 | 50 | <browser:renamed-page | 50 | <browser:renamed-page |
722 | 51 | for="canonical.launchpad.webapp.interfaces.ILaunchpadApplication" | 51 | for="canonical.launchpad.webapp.interfaces.ILaunchpadApplication" |
724 | 52 | layer="canonical.launchpad.layers.BlueprintsLayer" | 52 | layer="lp.blueprints.publisher.BlueprintsLayer" |
725 | 53 | name="+about" | 53 | name="+about" |
726 | 54 | new_name="+tour/feature-tracking" | 54 | new_name="+tour/feature-tracking" |
727 | 55 | rootsite="mainsite" | 55 | rootsite="mainsite" |
728 | 56 | /> | 56 | /> |
729 | 57 | <browser:renamed-page | 57 | <browser:renamed-page |
730 | 58 | for="canonical.launchpad.webapp.interfaces.ILaunchpadApplication" | 58 | for="canonical.launchpad.webapp.interfaces.ILaunchpadApplication" |
732 | 59 | layer="canonical.launchpad.layers.BlueprintsLayer" | 59 | layer="lp.blueprints.publisher.BlueprintsLayer" |
733 | 60 | name="+faq" | 60 | name="+faq" |
734 | 61 | new_name="+tour/feature-tracking" | 61 | new_name="+tour/feature-tracking" |
735 | 62 | rootsite="mainsite" | 62 | rootsite="mainsite" |
736 | @@ -64,7 +64,7 @@ | |||
737 | 64 | <browser:renamed-page | 64 | <browser:renamed-page |
738 | 65 | name="+tour" | 65 | name="+tour" |
739 | 66 | for="canonical.launchpad.webapp.interfaces.ILaunchpadApplication" | 66 | for="canonical.launchpad.webapp.interfaces.ILaunchpadApplication" |
741 | 67 | layer="canonical.launchpad.layers.BlueprintsLayer" | 67 | layer="lp.blueprints.publisher.BlueprintsLayer" |
742 | 68 | new_name="+tour/feature-tracking" | 68 | new_name="+tour/feature-tracking" |
743 | 69 | rootsite="mainsite" | 69 | rootsite="mainsite" |
744 | 70 | /> | 70 | /> |
745 | @@ -72,14 +72,14 @@ | |||
746 | 72 | <!-- Marketing material for Bugs. --> | 72 | <!-- Marketing material for Bugs. --> |
747 | 73 | <browser:renamed-page | 73 | <browser:renamed-page |
748 | 74 | for="canonical.launchpad.webapp.interfaces.ILaunchpadApplication" | 74 | for="canonical.launchpad.webapp.interfaces.ILaunchpadApplication" |
750 | 75 | layer="canonical.launchpad.layers.BugsLayer" | 75 | layer="lp.bugs.publisher.BugsLayer" |
751 | 76 | name="+about" | 76 | name="+about" |
752 | 77 | new_name="+tour/bugs" | 77 | new_name="+tour/bugs" |
753 | 78 | rootsite="mainsite" | 78 | rootsite="mainsite" |
754 | 79 | /> | 79 | /> |
755 | 80 | <browser:renamed-page | 80 | <browser:renamed-page |
756 | 81 | for="canonical.launchpad.webapp.interfaces.ILaunchpadApplication" | 81 | for="canonical.launchpad.webapp.interfaces.ILaunchpadApplication" |
758 | 82 | layer="canonical.launchpad.layers.BugsLayer" | 82 | layer="lp.bugs.publisher.BugsLayer" |
759 | 83 | name="+faq" | 83 | name="+faq" |
760 | 84 | new_name="+tour/bugs" | 84 | new_name="+tour/bugs" |
761 | 85 | rootsite="mainsite" | 85 | rootsite="mainsite" |
762 | @@ -87,7 +87,7 @@ | |||
763 | 87 | <browser:renamed-page | 87 | <browser:renamed-page |
764 | 88 | name="+tour" | 88 | name="+tour" |
765 | 89 | for="canonical.launchpad.webapp.interfaces.ILaunchpadApplication" | 89 | for="canonical.launchpad.webapp.interfaces.ILaunchpadApplication" |
767 | 90 | layer="canonical.launchpad.layers.BugsLayer" | 90 | layer="lp.bugs.publisher.BugsLayer" |
768 | 91 | new_name="+tour/bugs" | 91 | new_name="+tour/bugs" |
769 | 92 | rootsite="mainsite" | 92 | rootsite="mainsite" |
770 | 93 | /> | 93 | /> |
771 | @@ -119,14 +119,14 @@ | |||
772 | 119 | <!-- Marketing material for Translations. --> | 119 | <!-- Marketing material for Translations. --> |
773 | 120 | <browser:renamed-page | 120 | <browser:renamed-page |
774 | 121 | for="canonical.launchpad.webapp.interfaces.ILaunchpadApplication" | 121 | for="canonical.launchpad.webapp.interfaces.ILaunchpadApplication" |
776 | 122 | layer="canonical.launchpad.layers.TranslationsLayer" | 122 | layer="lp.translations.publisher.TranslationsLayer" |
777 | 123 | name="+about" | 123 | name="+about" |
778 | 124 | new_name="+tour/translation" | 124 | new_name="+tour/translation" |
779 | 125 | rootsite="mainsite" | 125 | rootsite="mainsite" |
780 | 126 | /> | 126 | /> |
781 | 127 | <browser:renamed-page | 127 | <browser:renamed-page |
782 | 128 | for="canonical.launchpad.webapp.interfaces.ILaunchpadApplication" | 128 | for="canonical.launchpad.webapp.interfaces.ILaunchpadApplication" |
784 | 129 | layer="canonical.launchpad.layers.TranslationsLayer" | 129 | layer="lp.translations.publisher.TranslationsLayer" |
785 | 130 | name="+faq" | 130 | name="+faq" |
786 | 131 | new_name="+tour/translation" | 131 | new_name="+tour/translation" |
787 | 132 | rootsite="mainsite" | 132 | rootsite="mainsite" |
788 | @@ -134,7 +134,7 @@ | |||
789 | 134 | <browser:renamed-page | 134 | <browser:renamed-page |
790 | 135 | name="+tour" | 135 | name="+tour" |
791 | 136 | for="canonical.launchpad.webapp.interfaces.ILaunchpadApplication" | 136 | for="canonical.launchpad.webapp.interfaces.ILaunchpadApplication" |
793 | 137 | layer="canonical.launchpad.layers.TranslationsLayer" | 137 | layer="lp.translations.publisher.TranslationsLayer" |
794 | 138 | new_name="+tour/translation" | 138 | new_name="+tour/translation" |
795 | 139 | rootsite="mainsite" | 139 | rootsite="mainsite" |
796 | 140 | /> | 140 | /> |
797 | 141 | 141 | ||
798 | === modified file 'lib/lp/answers/browser/configure.zcml' | |||
799 | --- lib/lp/answers/browser/configure.zcml 2009-11-22 17:28:49 +0000 | |||
800 | +++ lib/lp/answers/browser/configure.zcml 2010-07-22 20:59:01 +0000 | |||
801 | @@ -14,7 +14,7 @@ | |||
802 | 14 | IQuestionCollection. --> | 14 | IQuestionCollection. --> |
803 | 15 | <browser:defaultView | 15 | <browser:defaultView |
804 | 16 | for="lp.answers.interfaces.questioncollection.IQuestionCollection" | 16 | for="lp.answers.interfaces.questioncollection.IQuestionCollection" |
806 | 17 | layer="canonical.launchpad.layers.AnswersLayer" | 17 | layer="lp.answers.publisher.AnswersLayer" |
807 | 18 | name="+tickets" | 18 | name="+tickets" |
808 | 19 | /> | 19 | /> |
809 | 20 | <browser:page | 20 | <browser:page |
810 | @@ -351,7 +351,7 @@ | |||
811 | 351 | 351 | ||
812 | 352 | <browser:defaultView | 352 | <browser:defaultView |
813 | 353 | for="canonical.launchpad.interfaces.IPerson" | 353 | for="canonical.launchpad.interfaces.IPerson" |
815 | 354 | layer="canonical.launchpad.layers.AnswersLayer" | 354 | layer="lp.answers.publisher.AnswersLayer" |
816 | 355 | name="+questions" | 355 | name="+questions" |
817 | 356 | /> | 356 | /> |
818 | 357 | 357 | ||
819 | 358 | 358 | ||
820 | === modified file 'lib/lp/answers/browser/tests/views.txt' | |||
821 | --- lib/lp/answers/browser/tests/views.txt 2010-04-16 15:06:55 +0000 | |||
822 | +++ lib/lp/answers/browser/tests/views.txt 2010-07-22 20:59:01 +0000 | |||
823 | @@ -860,7 +860,7 @@ | |||
824 | 860 | the question listing table. Products display the default columns of | 860 | the question listing table. Products display the default columns of |
825 | 861 | Summary, Created, Submitter, Assignee, and Status. | 861 | Summary, Created, Submitter, Assignee, and Status. |
826 | 862 | 862 | ||
828 | 863 | >>> from canonical.launchpad.layers import AnswersLayer | 863 | >>> from lp.answers.publisher import AnswersLayer |
829 | 864 | >>> from canonical.launchpad.testing.pages import ( | 864 | >>> from canonical.launchpad.testing.pages import ( |
830 | 865 | ... extract_text, find_tag_by_id) | 865 | ... extract_text, find_tag_by_id) |
831 | 866 | 866 | ||
832 | 867 | 867 | ||
833 | === modified file 'lib/lp/answers/configure.zcml' | |||
834 | --- lib/lp/answers/configure.zcml 2010-02-17 11:19:42 +0000 | |||
835 | +++ lib/lp/answers/configure.zcml 2010-07-22 20:59:01 +0000 | |||
836 | @@ -10,6 +10,10 @@ | |||
837 | 10 | 10 | ||
838 | 11 | <include package=".browser" /> | 11 | <include package=".browser" /> |
839 | 12 | 12 | ||
840 | 13 | <publisher | ||
841 | 14 | name="answers" | ||
842 | 15 | factory="lp.answers.publisher.answers_request_publication_factory"/> | ||
843 | 16 | |||
844 | 13 | <subscriber | 17 | <subscriber |
845 | 14 | for=".interfaces.question.IQuestion | 18 | for=".interfaces.question.IQuestion |
846 | 15 | lazr.lifecycle.interfaces.IObjectCreatedEvent" | 19 | lazr.lifecycle.interfaces.IObjectCreatedEvent" |
847 | @@ -235,7 +239,7 @@ | |||
848 | 235 | 239 | ||
849 | 236 | 240 | ||
850 | 237 | <lp:help-folder | 241 | <lp:help-folder |
852 | 238 | folder="help" type="canonical.launchpad.layers.AnswersLayer" /> | 242 | folder="help" type="lp.answers.publisher.AnswersLayer" /> |
853 | 239 | <adapter | 243 | <adapter |
854 | 240 | name="answers" | 244 | name="answers" |
855 | 241 | provides="canonical.launchpad.webapp.interfaces.IBreadcrumb" | 245 | provides="canonical.launchpad.webapp.interfaces.IBreadcrumb" |
856 | 242 | 246 | ||
857 | === added file 'lib/lp/answers/publisher.py' | |||
858 | --- lib/lp/answers/publisher.py 1970-01-01 00:00:00 +0000 | |||
859 | +++ lib/lp/answers/publisher.py 2010-07-22 20:59:01 +0000 | |||
860 | @@ -0,0 +1,41 @@ | |||
861 | 1 | # Copyright 2010 Canonical Ltd. This software is licensed under the | ||
862 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | ||
863 | 3 | |||
864 | 4 | """Answers's custom publication.""" | ||
865 | 5 | |||
866 | 6 | __metaclass__ = type | ||
867 | 7 | __all__ = [ | ||
868 | 8 | 'AnswersBrowserRequest', | ||
869 | 9 | 'AnswersLayer', | ||
870 | 10 | 'answers_request_publication_factory', | ||
871 | 11 | ] | ||
872 | 12 | |||
873 | 13 | |||
874 | 14 | from zope.interface import implements | ||
875 | 15 | from zope.publisher.interfaces.browser import ( | ||
876 | 16 | IBrowserRequest, IDefaultBrowserLayer) | ||
877 | 17 | |||
878 | 18 | from canonical.launchpad.webapp.publication import LaunchpadBrowserPublication | ||
879 | 19 | from canonical.launchpad.webapp.servers import ( | ||
880 | 20 | LaunchpadBrowserRequest, VHostWebServiceRequestPublicationFactory) | ||
881 | 21 | |||
882 | 22 | |||
883 | 23 | class AnswersLayer(IBrowserRequest, IDefaultBrowserLayer): | ||
884 | 24 | """The Answers layer.""" | ||
885 | 25 | |||
886 | 26 | |||
887 | 27 | class AnswersBrowserRequest(LaunchpadBrowserRequest): | ||
888 | 28 | """Instances of AnswersBrowserRequest provide `AnswersLayer`.""" | ||
889 | 29 | implements(AnswersLayer) | ||
890 | 30 | |||
891 | 31 | def __init__(self, body_instream, environ, response=None): | ||
892 | 32 | super(AnswersBrowserRequest, self).__init__( | ||
893 | 33 | body_instream, environ, response) | ||
894 | 34 | # Many of the responses from Answers vary based on language. | ||
895 | 35 | self.response.setHeader( | ||
896 | 36 | 'Vary', 'Cookie, Authorization, Accept-Language') | ||
897 | 37 | |||
898 | 38 | |||
899 | 39 | def answers_request_publication_factory(): | ||
900 | 40 | return VHostWebServiceRequestPublicationFactory( | ||
901 | 41 | 'answers', AnswersBrowserRequest, LaunchpadBrowserPublication) | ||
902 | 0 | 42 | ||
903 | === added file 'lib/lp/answers/tests/test_publisher.py' | |||
904 | --- lib/lp/answers/tests/test_publisher.py 1970-01-01 00:00:00 +0000 | |||
905 | +++ lib/lp/answers/tests/test_publisher.py 2010-07-22 20:59:01 +0000 | |||
906 | @@ -0,0 +1,49 @@ | |||
907 | 1 | # Copyright 2010 Canonical Ltd. This software is licensed under the | ||
908 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | ||
909 | 3 | |||
910 | 4 | """Tests for answers's custom publications.""" | ||
911 | 5 | |||
912 | 6 | __metaclass__ = type | ||
913 | 7 | |||
914 | 8 | import StringIO | ||
915 | 9 | |||
916 | 10 | from canonical.config import config | ||
917 | 11 | from canonical.launchpad.layers import WebServiceLayer | ||
918 | 12 | from canonical.testing.layers import FunctionalLayer | ||
919 | 13 | |||
920 | 14 | from lp.testing import TestCase | ||
921 | 15 | from lp.testing.publication import get_request_and_publication | ||
922 | 16 | |||
923 | 17 | from lp.answers.publisher import AnswersLayer, AnswersBrowserRequest | ||
924 | 18 | |||
925 | 19 | |||
926 | 20 | class TestRegistration(TestCase): | ||
927 | 21 | """Answers' publication customizations are installed correctly.""" | ||
928 | 22 | |||
929 | 23 | layer = FunctionalLayer | ||
930 | 24 | |||
931 | 25 | def test_answers_request_provides_answers_layer(self): | ||
932 | 26 | # The request constructed for requests to the answers hostname | ||
933 | 27 | # provides AnswersLayer. | ||
934 | 28 | request, publication = get_request_and_publication( | ||
935 | 29 | host=config.vhost.answers.hostname) | ||
936 | 30 | self.assertProvides(request, AnswersLayer) | ||
937 | 31 | |||
938 | 32 | def test_answers_host_has_api(self): | ||
939 | 33 | # Requests to /api on the answers domain are treated as web service | ||
940 | 34 | # requests. | ||
941 | 35 | request, publication = get_request_and_publication( | ||
942 | 36 | host=config.vhost.answers.hostname, | ||
943 | 37 | extra_environment={'PATH_INFO': '/api/1.0'}) | ||
944 | 38 | # XXX MichaelHudson, 2010-07-20, bug=607664: WebServiceLayer only | ||
945 | 39 | # actually provides WebServiceLayer in the sense of verifyObject after | ||
946 | 40 | # traversal has started. | ||
947 | 41 | self.assertTrue(WebServiceLayer.providedBy(request)) | ||
948 | 42 | |||
949 | 43 | def test_response_should_vary_based_on_language(self): | ||
950 | 44 | # Responses to requests to answers pages have the 'Vary' header set to | ||
951 | 45 | # include Accept-Language. | ||
952 | 46 | request = AnswersBrowserRequest(StringIO.StringIO(''), {}) | ||
953 | 47 | self.assertEquals( | ||
954 | 48 | request.response.getHeader('Vary'), | ||
955 | 49 | 'Cookie, Authorization, Accept-Language') | ||
956 | 0 | 50 | ||
957 | === modified file 'lib/lp/app/tests/test_help.py' | |||
958 | --- lib/lp/app/tests/test_help.py 2010-07-22 01:48:51 +0000 | |||
959 | +++ lib/lp/app/tests/test_help.py 2010-07-22 20:59:01 +0000 | |||
960 | @@ -8,17 +8,19 @@ | |||
961 | 8 | 8 | ||
962 | 9 | from zope.component import getUtility | 9 | from zope.component import getUtility |
963 | 10 | 10 | ||
964 | 11 | |||
965 | 12 | from canonical.testing.layers import FunctionalLayer | ||
966 | 13 | from canonical.launchpad.layers import ( | ||
967 | 14 | AnswersLayer, BlueprintsLayer, BugsLayer, LaunchpadLayer, | ||
968 | 15 | TranslationsLayer) | ||
969 | 16 | from canonical.launchpad.testing.systemdocs import create_view | 11 | from canonical.launchpad.testing.systemdocs import create_view |
970 | 17 | from canonical.launchpad.webapp.interfaces import ILaunchpadApplication | 12 | from canonical.launchpad.webapp.interfaces import ILaunchpadApplication |
971 | 13 | from canonical.launchpad.layers import LaunchpadLayer | ||
972 | 14 | from canonical.testing.layers import FunctionalLayer | ||
973 | 18 | 15 | ||
974 | 19 | from canonical.lazr.folder import ExportedFolder | 16 | from canonical.lazr.folder import ExportedFolder |
975 | 20 | 17 | ||
976 | 18 | from lp.answers.publisher import AnswersLayer | ||
977 | 19 | from lp.blueprints.publisher import BlueprintsLayer | ||
978 | 20 | from lp.bugs.publisher import BugsLayer | ||
979 | 21 | from lp.code.publisher import CodeLayer | 21 | from lp.code.publisher import CodeLayer |
980 | 22 | from lp.translations.publisher import TranslationsLayer | ||
981 | 23 | |||
982 | 22 | 24 | ||
983 | 23 | # The root of the tree | 25 | # The root of the tree |
984 | 24 | ROOT = os.path.realpath( | 26 | ROOT = os.path.realpath( |
985 | 25 | 27 | ||
986 | === modified file 'lib/lp/blueprints/browser/configure.zcml' | |||
987 | --- lib/lp/blueprints/browser/configure.zcml 2010-02-17 11:19:42 +0000 | |||
988 | +++ lib/lp/blueprints/browser/configure.zcml 2010-07-22 20:59:01 +0000 | |||
989 | @@ -18,7 +18,7 @@ | |||
990 | 18 | <browser:defaultView | 18 | <browser:defaultView |
991 | 19 | for="lp.blueprints.interfaces.sprint.ISprint" | 19 | for="lp.blueprints.interfaces.sprint.ISprint" |
992 | 20 | name="+specs" | 20 | name="+specs" |
994 | 21 | layer="canonical.launchpad.layers.BlueprintLayer"/> | 21 | layer="lp.blueprints.publisher.BlueprintsLayer"/> |
995 | 22 | <browser:url | 22 | <browser:url |
996 | 23 | for="lp.blueprints.interfaces.sprint.ISprint" | 23 | for="lp.blueprints.interfaces.sprint.ISprint" |
997 | 24 | path_expression="name" | 24 | path_expression="name" |
998 | @@ -562,7 +562,7 @@ | |||
999 | 562 | <browser:defaultView | 562 | <browser:defaultView |
1000 | 563 | for="lp.registry.interfaces.distroseries.IDistroSeries" | 563 | for="lp.registry.interfaces.distroseries.IDistroSeries" |
1001 | 564 | name="+specs" | 564 | name="+specs" |
1003 | 565 | layer="canonical.launchpad.layers.BlueprintLayer"/> | 565 | layer="lp.blueprints.publisher.BlueprintsLayer"/> |
1004 | 566 | <browser:page | 566 | <browser:page |
1005 | 567 | name="+addspec" | 567 | name="+addspec" |
1006 | 568 | for="lp.registry.interfaces.distroseries.IDistroSeries" | 568 | for="lp.registry.interfaces.distroseries.IDistroSeries" |
1007 | 569 | 569 | ||
1008 | === modified file 'lib/lp/blueprints/browser/tests/test_specificationtarget.py' | |||
1009 | --- lib/lp/blueprints/browser/tests/test_specificationtarget.py 2009-11-08 19:34:52 +0000 | |||
1010 | +++ lib/lp/blueprints/browser/tests/test_specificationtarget.py 2010-07-22 20:59:01 +0000 | |||
1011 | @@ -5,11 +5,11 @@ | |||
1012 | 5 | 5 | ||
1013 | 6 | import unittest | 6 | import unittest |
1014 | 7 | 7 | ||
1015 | 8 | from canonical.launchpad.layers import BlueprintLayer | ||
1016 | 9 | from canonical.testing.layers import DatabaseFunctionalLayer | 8 | from canonical.testing.layers import DatabaseFunctionalLayer |
1017 | 10 | 9 | ||
1018 | 11 | from lp.blueprints.interfaces.specificationtarget import ( | 10 | from lp.blueprints.interfaces.specificationtarget import ( |
1019 | 12 | IHasSpecifications, ISpecificationTarget) | 11 | IHasSpecifications, ISpecificationTarget) |
1020 | 12 | from lp.blueprints.publisher import BlueprintsLayer | ||
1021 | 13 | from lp.testing import login_person, TestCaseWithFactory | 13 | from lp.testing import login_person, TestCaseWithFactory |
1022 | 14 | from lp.testing.views import create_view | 14 | from lp.testing.views import create_view |
1023 | 15 | 15 | ||
1024 | @@ -58,7 +58,7 @@ | |||
1025 | 58 | def verify_involvment(self, context): | 58 | def verify_involvment(self, context): |
1026 | 59 | self.assertTrue(IHasSpecifications.providedBy(context)) | 59 | self.assertTrue(IHasSpecifications.providedBy(context)) |
1027 | 60 | view = create_view( | 60 | view = create_view( |
1029 | 61 | context, '+specs', layer=BlueprintLayer, principal=self.user) | 61 | context, '+specs', layer=BlueprintsLayer, principal=self.user) |
1030 | 62 | self.assertTrue( | 62 | self.assertTrue( |
1031 | 63 | '<div id="involvement" class="portlet involvement">' in view()) | 63 | '<div id="involvement" class="portlet involvement">' in view()) |
1032 | 64 | 64 | ||
1033 | @@ -78,7 +78,7 @@ | |||
1034 | 78 | context = self.factory.makePerson(name='pistachio') | 78 | context = self.factory.makePerson(name='pistachio') |
1035 | 79 | self.assertTrue(IHasSpecifications.providedBy(context)) | 79 | self.assertTrue(IHasSpecifications.providedBy(context)) |
1036 | 80 | view = create_view( | 80 | view = create_view( |
1038 | 81 | context, '+specs', layer=BlueprintLayer, principal=self.user) | 81 | context, '+specs', layer=BlueprintsLayer, principal=self.user) |
1039 | 82 | self.assertFalse( | 82 | self.assertFalse( |
1040 | 83 | '<div id="involvement" class="portlet involvement">' in view()) | 83 | '<div id="involvement" class="portlet involvement">' in view()) |
1041 | 84 | 84 | ||
1042 | 85 | 85 | ||
1043 | === modified file 'lib/lp/blueprints/configure.zcml' | |||
1044 | --- lib/lp/blueprints/configure.zcml 2009-09-23 03:36:55 +0000 | |||
1045 | +++ lib/lp/blueprints/configure.zcml 2010-07-22 20:59:01 +0000 | |||
1046 | @@ -12,8 +12,12 @@ | |||
1047 | 12 | <include | 12 | <include |
1048 | 13 | package=".browser"/> | 13 | package=".browser"/> |
1049 | 14 | 14 | ||
1050 | 15 | <publisher | ||
1051 | 16 | name="blueprints" | ||
1052 | 17 | factory="lp.blueprints.publisher.blueprints_request_publication_factory"/> | ||
1053 | 18 | |||
1054 | 15 | <lp:help-folder | 19 | <lp:help-folder |
1056 | 16 | folder="help" type="canonical.launchpad.layers.BlueprintsLayer" /> | 20 | folder="help" type="lp.blueprints.publisher.BlueprintsLayer" /> |
1057 | 17 | 21 | ||
1058 | 18 | <!-- Sprint --> | 22 | <!-- Sprint --> |
1059 | 19 | 23 | ||
1060 | 20 | 24 | ||
1061 | === added file 'lib/lp/blueprints/publisher.py' | |||
1062 | --- lib/lp/blueprints/publisher.py 1970-01-01 00:00:00 +0000 | |||
1063 | +++ lib/lp/blueprints/publisher.py 2010-07-22 20:59:01 +0000 | |||
1064 | @@ -0,0 +1,34 @@ | |||
1065 | 1 | # Copyright 2010 Canonical Ltd. This software is licensed under the | ||
1066 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | ||
1067 | 3 | |||
1068 | 4 | """Blueprints' custom publication.""" | ||
1069 | 5 | |||
1070 | 6 | __metaclass__ = type | ||
1071 | 7 | __all__ = [ | ||
1072 | 8 | 'BlueprintsBrowserRequest', | ||
1073 | 9 | 'BlueprintsLayer', | ||
1074 | 10 | 'blueprints_request_publication_factory', | ||
1075 | 11 | ] | ||
1076 | 12 | |||
1077 | 13 | |||
1078 | 14 | from zope.interface import implements | ||
1079 | 15 | from zope.publisher.interfaces.browser import ( | ||
1080 | 16 | IBrowserRequest, IDefaultBrowserLayer) | ||
1081 | 17 | |||
1082 | 18 | from canonical.launchpad.webapp.publication import LaunchpadBrowserPublication | ||
1083 | 19 | from canonical.launchpad.webapp.servers import ( | ||
1084 | 20 | LaunchpadBrowserRequest, VHostWebServiceRequestPublicationFactory) | ||
1085 | 21 | |||
1086 | 22 | |||
1087 | 23 | class BlueprintsLayer(IBrowserRequest, IDefaultBrowserLayer): | ||
1088 | 24 | """The Blueprints layer.""" | ||
1089 | 25 | |||
1090 | 26 | |||
1091 | 27 | class BlueprintsBrowserRequest(LaunchpadBrowserRequest): | ||
1092 | 28 | """Instances of BlueprintsBrowserRequest provide `BlueprintsLayer`.""" | ||
1093 | 29 | implements(BlueprintsLayer) | ||
1094 | 30 | |||
1095 | 31 | |||
1096 | 32 | def blueprints_request_publication_factory(): | ||
1097 | 33 | return VHostWebServiceRequestPublicationFactory( | ||
1098 | 34 | 'blueprints', BlueprintsBrowserRequest, LaunchpadBrowserPublication) | ||
1099 | 0 | 35 | ||
1100 | === added file 'lib/lp/blueprints/tests/test_publisher.py' | |||
1101 | --- lib/lp/blueprints/tests/test_publisher.py 1970-01-01 00:00:00 +0000 | |||
1102 | +++ lib/lp/blueprints/tests/test_publisher.py 2010-07-22 20:59:01 +0000 | |||
1103 | @@ -0,0 +1,39 @@ | |||
1104 | 1 | # Copyright 2010 Canonical Ltd. This software is licensed under the | ||
1105 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | ||
1106 | 3 | |||
1107 | 4 | """Tests for blueprints' custom publications.""" | ||
1108 | 5 | |||
1109 | 6 | __metaclass__ = type | ||
1110 | 7 | |||
1111 | 8 | from canonical.config import config | ||
1112 | 9 | from canonical.launchpad.layers import WebServiceLayer | ||
1113 | 10 | from canonical.testing.layers import FunctionalLayer | ||
1114 | 11 | |||
1115 | 12 | from lp.testing import TestCase | ||
1116 | 13 | from lp.testing.publication import get_request_and_publication | ||
1117 | 14 | |||
1118 | 15 | from lp.blueprints.publisher import BlueprintsLayer | ||
1119 | 16 | |||
1120 | 17 | |||
1121 | 18 | class TestRegistration(TestCase): | ||
1122 | 19 | """Blueprints's publication customizations are installed correctly.""" | ||
1123 | 20 | |||
1124 | 21 | layer = FunctionalLayer | ||
1125 | 22 | |||
1126 | 23 | def test_blueprints_request_provides_blueprints_layer(self): | ||
1127 | 24 | # The request constructed for requests to the blueprints hostname | ||
1128 | 25 | # provides BlueprintsLayer. | ||
1129 | 26 | request, publication = get_request_and_publication( | ||
1130 | 27 | host=config.vhost.blueprints.hostname) | ||
1131 | 28 | self.assertProvides(request, BlueprintsLayer) | ||
1132 | 29 | |||
1133 | 30 | def test_blueprints_host_has_api(self): | ||
1134 | 31 | # Requests to /api on the blueprints domain are treated as web service | ||
1135 | 32 | # requests. | ||
1136 | 33 | request, publication = get_request_and_publication( | ||
1137 | 34 | host=config.vhost.blueprints.hostname, | ||
1138 | 35 | extra_environment={'PATH_INFO': '/api/1.0'}) | ||
1139 | 36 | # XXX MichaelHudson, 2010-07-20, bug=607664: WebServiceLayer only | ||
1140 | 37 | # actually provides WebServiceLayer in the sense of verifyObject after | ||
1141 | 38 | # traversal has started. | ||
1142 | 39 | self.assertTrue(WebServiceLayer.providedBy(request)) | ||
1143 | 0 | 40 | ||
1144 | === modified file 'lib/lp/bugs/browser/malone.py' | |||
1145 | --- lib/lp/bugs/browser/malone.py 2009-09-04 15:32:52 +0000 | |||
1146 | +++ lib/lp/bugs/browser/malone.py 2010-07-22 20:59:01 +0000 | |||
1147 | @@ -13,7 +13,6 @@ | |||
1148 | 13 | from zope.component import getUtility | 13 | from zope.component import getUtility |
1149 | 14 | from zope.security.interfaces import Unauthorized | 14 | from zope.security.interfaces import Unauthorized |
1150 | 15 | 15 | ||
1151 | 16 | import canonical.launchpad.layers | ||
1152 | 17 | 16 | ||
1153 | 18 | from canonical.launchpad.webapp import ( | 17 | from canonical.launchpad.webapp import ( |
1154 | 19 | Link, Navigation, canonical_url, stepto) | 18 | Link, Navigation, canonical_url, stepto) |
1155 | @@ -25,6 +24,7 @@ | |||
1156 | 25 | from lp.bugs.interfaces.bugtracker import IBugTrackerSet | 24 | from lp.bugs.interfaces.bugtracker import IBugTrackerSet |
1157 | 26 | from lp.bugs.interfaces.cve import ICveSet | 25 | from lp.bugs.interfaces.cve import ICveSet |
1158 | 27 | from lp.bugs.interfaces.malone import IMaloneApplication | 26 | from lp.bugs.interfaces.malone import IMaloneApplication |
1159 | 27 | from lp.bugs.publisher import BugsLayer | ||
1160 | 28 | from lp.registry.interfaces.distribution import IDistributionSet | 28 | from lp.registry.interfaces.distribution import IDistributionSet |
1161 | 29 | from lp.registry.interfaces.product import IProductSet | 29 | from lp.registry.interfaces.product import IProductSet |
1162 | 30 | 30 | ||
1163 | @@ -33,7 +33,7 @@ | |||
1164 | 33 | 33 | ||
1165 | 34 | usedfor = IMaloneApplication | 34 | usedfor = IMaloneApplication |
1166 | 35 | 35 | ||
1168 | 36 | newlayer = canonical.launchpad.layers.BugsLayer | 36 | newlayer = BugsLayer |
1169 | 37 | 37 | ||
1170 | 38 | @stepto('bugs') | 38 | @stepto('bugs') |
1171 | 39 | def bugs(self): | 39 | def bugs(self): |
1172 | 40 | 40 | ||
1173 | === modified file 'lib/lp/bugs/browser/tests/test_configure_bugtracker_links.py' | |||
1174 | --- lib/lp/bugs/browser/tests/test_configure_bugtracker_links.py 2010-06-17 15:26:05 +0000 | |||
1175 | +++ lib/lp/bugs/browser/tests/test_configure_bugtracker_links.py 2010-07-22 20:59:01 +0000 | |||
1176 | @@ -8,9 +8,10 @@ | |||
1177 | 8 | import unittest | 8 | import unittest |
1178 | 9 | 9 | ||
1179 | 10 | from canonical.launchpad.ftests import ANONYMOUS, login | 10 | from canonical.launchpad.ftests import ANONYMOUS, login |
1180 | 11 | from canonical.launchpad.layers import BugsLayer | ||
1181 | 12 | from canonical.testing import LaunchpadFunctionalLayer | 11 | from canonical.testing import LaunchpadFunctionalLayer |
1182 | 13 | 12 | ||
1183 | 13 | from lp.bugs.publisher import BugsLayer | ||
1184 | 14 | |||
1185 | 14 | from lp.testing import login_person, TestCaseWithFactory | 15 | from lp.testing import login_person, TestCaseWithFactory |
1186 | 15 | from lp.testing.views import create_initialized_view | 16 | from lp.testing.views import create_initialized_view |
1187 | 16 | 17 | ||
1188 | 17 | 18 | ||
1189 | === modified file 'lib/lp/bugs/configure.zcml' | |||
1190 | --- lib/lp/bugs/configure.zcml 2010-07-22 20:30:26 +0000 | |||
1191 | +++ lib/lp/bugs/configure.zcml 2010-07-22 20:59:01 +0000 | |||
1192 | @@ -12,8 +12,12 @@ | |||
1193 | 12 | <include | 12 | <include |
1194 | 13 | package=".browser"/> | 13 | package=".browser"/> |
1195 | 14 | 14 | ||
1196 | 15 | <publisher | ||
1197 | 16 | name="bugs" | ||
1198 | 17 | factory="lp.bugs.publisher.bugs_request_publication_factory"/> | ||
1199 | 18 | |||
1200 | 15 | <lp:help-folder | 19 | <lp:help-folder |
1202 | 16 | folder="help" type="canonical.launchpad.layers.BugsLayer" /> | 20 | folder="help" type="lp.bugs.publisher.BugsLayer" /> |
1203 | 17 | 21 | ||
1204 | 18 | <class | 22 | <class |
1205 | 19 | class="canonical.launchpad.database.BugActivity"> | 23 | class="canonical.launchpad.database.BugActivity"> |
1206 | 20 | 24 | ||
1207 | === added file 'lib/lp/bugs/publisher.py' | |||
1208 | --- lib/lp/bugs/publisher.py 1970-01-01 00:00:00 +0000 | |||
1209 | +++ lib/lp/bugs/publisher.py 2010-07-22 20:59:01 +0000 | |||
1210 | @@ -0,0 +1,34 @@ | |||
1211 | 1 | # Copyright 2010 Canonical Ltd. This software is licensed under the | ||
1212 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | ||
1213 | 3 | |||
1214 | 4 | """Bugs' custom publication.""" | ||
1215 | 5 | |||
1216 | 6 | __metaclass__ = type | ||
1217 | 7 | __all__ = [ | ||
1218 | 8 | 'BugsBrowserRequest', | ||
1219 | 9 | 'BugsLayer', | ||
1220 | 10 | 'bugs_request_publication_factory', | ||
1221 | 11 | ] | ||
1222 | 12 | |||
1223 | 13 | |||
1224 | 14 | from zope.interface import implements | ||
1225 | 15 | from zope.publisher.interfaces.browser import ( | ||
1226 | 16 | IBrowserRequest, IDefaultBrowserLayer) | ||
1227 | 17 | |||
1228 | 18 | from canonical.launchpad.webapp.publication import LaunchpadBrowserPublication | ||
1229 | 19 | from canonical.launchpad.webapp.servers import ( | ||
1230 | 20 | LaunchpadBrowserRequest, VHostWebServiceRequestPublicationFactory) | ||
1231 | 21 | |||
1232 | 22 | |||
1233 | 23 | class BugsLayer(IBrowserRequest, IDefaultBrowserLayer): | ||
1234 | 24 | """The Bugs layer.""" | ||
1235 | 25 | |||
1236 | 26 | |||
1237 | 27 | class BugsBrowserRequest(LaunchpadBrowserRequest): | ||
1238 | 28 | """Instances of BugBrowserRequest provide `BugsLayer`.""" | ||
1239 | 29 | implements(BugsLayer) | ||
1240 | 30 | |||
1241 | 31 | |||
1242 | 32 | def bugs_request_publication_factory(): | ||
1243 | 33 | return VHostWebServiceRequestPublicationFactory( | ||
1244 | 34 | 'bugs', BugsBrowserRequest, LaunchpadBrowserPublication) | ||
1245 | 0 | 35 | ||
1246 | === added file 'lib/lp/bugs/tests/test_publisher.py' | |||
1247 | --- lib/lp/bugs/tests/test_publisher.py 1970-01-01 00:00:00 +0000 | |||
1248 | +++ lib/lp/bugs/tests/test_publisher.py 2010-07-22 20:59:01 +0000 | |||
1249 | @@ -0,0 +1,39 @@ | |||
1250 | 1 | # Copyright 2010 Canonical Ltd. This software is licensed under the | ||
1251 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | ||
1252 | 3 | |||
1253 | 4 | """Tests for bugs' custom publications.""" | ||
1254 | 5 | |||
1255 | 6 | __metaclass__ = type | ||
1256 | 7 | |||
1257 | 8 | from canonical.config import config | ||
1258 | 9 | from canonical.launchpad.layers import WebServiceLayer | ||
1259 | 10 | from canonical.testing.layers import FunctionalLayer | ||
1260 | 11 | |||
1261 | 12 | from lp.testing import TestCase | ||
1262 | 13 | from lp.testing.publication import get_request_and_publication | ||
1263 | 14 | |||
1264 | 15 | from lp.bugs.publisher import BugsLayer | ||
1265 | 16 | |||
1266 | 17 | |||
1267 | 18 | class TestRegistration(TestCase): | ||
1268 | 19 | """Bugs publication customizations are installed correctly.""" | ||
1269 | 20 | |||
1270 | 21 | layer = FunctionalLayer | ||
1271 | 22 | |||
1272 | 23 | def test_bugs_request_provides_bugs_layer(self): | ||
1273 | 24 | # The request constructed for requests to the bugs hostname provides | ||
1274 | 25 | # BugsLayer. | ||
1275 | 26 | request, publication = get_request_and_publication( | ||
1276 | 27 | host=config.vhost.bugs.hostname) | ||
1277 | 28 | self.assertProvides(request, BugsLayer) | ||
1278 | 29 | |||
1279 | 30 | def test_bugs_host_has_api(self): | ||
1280 | 31 | # Requests to /api on the bugs domain are treated as web service | ||
1281 | 32 | # requests. | ||
1282 | 33 | request, publication = get_request_and_publication( | ||
1283 | 34 | host=config.vhost.bugs.hostname, | ||
1284 | 35 | extra_environment={'PATH_INFO': '/api/1.0'}) | ||
1285 | 36 | # XXX MichaelHudson, 2010-07-20, bug=607664: WebServiceLayer only | ||
1286 | 37 | # actually provides WebServiceLayer in the sense of verifyObject after | ||
1287 | 38 | # traversal has started. | ||
1288 | 39 | self.assertTrue(WebServiceLayer.providedBy(request)) | ||
1289 | 0 | 40 | ||
1290 | === modified file 'lib/lp/code/tests/test_publisher.py' | |||
1291 | --- lib/lp/code/tests/test_publisher.py 2010-07-20 23:53:33 +0000 | |||
1292 | +++ lib/lp/code/tests/test_publisher.py 2010-07-22 20:59:01 +0000 | |||
1293 | @@ -5,8 +5,6 @@ | |||
1294 | 5 | 5 | ||
1295 | 6 | __metaclass__ = type | 6 | __metaclass__ = type |
1296 | 7 | 7 | ||
1297 | 8 | import unittest | ||
1298 | 9 | |||
1299 | 10 | from canonical.config import config | 8 | from canonical.config import config |
1300 | 11 | from canonical.launchpad.layers import WebServiceLayer | 9 | from canonical.launchpad.layers import WebServiceLayer |
1301 | 12 | from canonical.testing.layers import FunctionalLayer | 10 | from canonical.testing.layers import FunctionalLayer |
1302 | @@ -39,7 +37,3 @@ | |||
1303 | 39 | # actually provides WebServiceLayer in the sense of verifyObject after | 37 | # actually provides WebServiceLayer in the sense of verifyObject after |
1304 | 40 | # traversal has started. | 38 | # traversal has started. |
1305 | 41 | self.assertTrue(WebServiceLayer.providedBy(request)) | 39 | self.assertTrue(WebServiceLayer.providedBy(request)) |
1306 | 42 | |||
1307 | 43 | |||
1308 | 44 | def test_suite(): | ||
1309 | 45 | return unittest.TestLoader().loadTestsFromName(__name__) | ||
1310 | 46 | 40 | ||
1311 | === modified file 'lib/lp/registry/browser/configure.zcml' | |||
1312 | --- lib/lp/registry/browser/configure.zcml 2010-07-16 15:40:14 +0000 | |||
1313 | +++ lib/lp/registry/browser/configure.zcml 2010-07-22 20:59:01 +0000 | |||
1314 | @@ -57,7 +57,7 @@ | |||
1315 | 57 | name="+index"/> | 57 | name="+index"/> |
1316 | 58 | <browser:defaultView | 58 | <browser:defaultView |
1317 | 59 | for="lp.registry.interfaces.distroseries.IDistroSeries" | 59 | for="lp.registry.interfaces.distroseries.IDistroSeries" |
1319 | 60 | layer="canonical.launchpad.layers.BugsLayer" | 60 | layer="lp.bugs.publisher.BugsLayer" |
1320 | 61 | name="+bugs-index"/> | 61 | name="+bugs-index"/> |
1321 | 62 | <browser:page | 62 | <browser:page |
1322 | 63 | for="lp.registry.interfaces.distroseries.IDistroSeries" | 63 | for="lp.registry.interfaces.distroseries.IDistroSeries" |
1323 | @@ -294,15 +294,15 @@ | |||
1324 | 294 | <browser:defaultView | 294 | <browser:defaultView |
1325 | 295 | for="lp.registry.interfaces.projectgroup.IProjectGroup" | 295 | for="lp.registry.interfaces.projectgroup.IProjectGroup" |
1326 | 296 | name="+bugs" | 296 | name="+bugs" |
1328 | 297 | layer="canonical.launchpad.layers.BugsLayer"/> | 297 | layer="lp.bugs.publisher.BugsLayer"/> |
1329 | 298 | <browser:defaultView | 298 | <browser:defaultView |
1330 | 299 | for="lp.registry.interfaces.projectgroup.IProjectGroup" | 299 | for="lp.registry.interfaces.projectgroup.IProjectGroup" |
1331 | 300 | name="+specs" | 300 | name="+specs" |
1333 | 301 | layer="canonical.launchpad.layers.BlueprintLayer"/> | 301 | layer="lp.blueprints.publisher.BlueprintsLayer"/> |
1334 | 302 | <browser:defaultView | 302 | <browser:defaultView |
1335 | 303 | for="lp.registry.interfaces.projectgroup.IProjectGroup" | 303 | for="lp.registry.interfaces.projectgroup.IProjectGroup" |
1336 | 304 | name="+questions" | 304 | name="+questions" |
1338 | 305 | layer="canonical.launchpad.layers.AnswersLayer"/> | 305 | layer="lp.answers.publisher.AnswersLayer"/> |
1339 | 306 | <browser:pages | 306 | <browser:pages |
1340 | 307 | for="lp.registry.interfaces.projectgroup.IProjectGroup" | 307 | for="lp.registry.interfaces.projectgroup.IProjectGroup" |
1341 | 308 | class="lp.registry.browser.project.ProjectView" | 308 | class="lp.registry.browser.project.ProjectView" |
1342 | @@ -408,7 +408,7 @@ | |||
1343 | 408 | <browser:defaultView | 408 | <browser:defaultView |
1344 | 409 | for="lp.registry.interfaces.projectgroup.IProjectGroupSeries" | 409 | for="lp.registry.interfaces.projectgroup.IProjectGroupSeries" |
1345 | 410 | name="+specs" | 410 | name="+specs" |
1347 | 411 | layer="canonical.launchpad.layers.BlueprintLayer"/> | 411 | layer="lp.blueprints.publisher.BlueprintsLayer"/> |
1348 | 412 | <browser:menus | 412 | <browser:menus |
1349 | 413 | classes=" | 413 | classes=" |
1350 | 414 | ProjectActionMenu | 414 | ProjectActionMenu |
1351 | @@ -428,11 +428,11 @@ | |||
1352 | 428 | name="+index"/> | 428 | name="+index"/> |
1353 | 429 | <browser:defaultView | 429 | <browser:defaultView |
1354 | 430 | for="lp.registry.interfaces.distributionsourcepackage.IDistributionSourcePackage" | 430 | for="lp.registry.interfaces.distributionsourcepackage.IDistributionSourcePackage" |
1356 | 431 | layer="canonical.launchpad.layers.AnswersLayer" | 431 | layer="lp.answers.publisher.AnswersLayer" |
1357 | 432 | name="+questions"/> | 432 | name="+questions"/> |
1358 | 433 | <browser:defaultView | 433 | <browser:defaultView |
1359 | 434 | for="lp.registry.interfaces.distributionsourcepackage.IDistributionSourcePackage" | 434 | for="lp.registry.interfaces.distributionsourcepackage.IDistributionSourcePackage" |
1361 | 435 | layer="canonical.launchpad.layers.BugsLayer" | 435 | layer="lp.bugs.publisher.BugsLayer" |
1362 | 436 | name="+bugs"/> | 436 | name="+bugs"/> |
1363 | 437 | <browser:url | 437 | <browser:url |
1364 | 438 | for="lp.registry.interfaces.distributionsourcepackage.IDistributionSourcePackage" | 438 | for="lp.registry.interfaces.distributionsourcepackage.IDistributionSourcePackage" |
1365 | @@ -762,11 +762,11 @@ | |||
1366 | 762 | name="+index"/> | 762 | name="+index"/> |
1367 | 763 | <browser:defaultView | 763 | <browser:defaultView |
1368 | 764 | for="lp.registry.interfaces.person.IPerson" | 764 | for="lp.registry.interfaces.person.IPerson" |
1370 | 765 | layer="canonical.launchpad.layers.BlueprintLayer" | 765 | layer="lp.blueprints.publisher.BlueprintsLayer" |
1371 | 766 | name="+specs"/> | 766 | name="+specs"/> |
1372 | 767 | <browser:defaultView | 767 | <browser:defaultView |
1373 | 768 | for="lp.registry.interfaces.person.IPerson" | 768 | for="lp.registry.interfaces.person.IPerson" |
1375 | 769 | layer="canonical.launchpad.layers.BugsLayer" | 769 | layer="lp.bugs.publisher.BugsLayer" |
1376 | 770 | name="+bugs"/> | 770 | name="+bugs"/> |
1377 | 771 | <adapter | 771 | <adapter |
1378 | 772 | factory="lp.registry.browser.person.PersonXHTMLRepresentation" | 772 | factory="lp.registry.browser.person.PersonXHTMLRepresentation" |
1379 | @@ -1353,18 +1353,18 @@ | |||
1380 | 1353 | <browser:defaultView | 1353 | <browser:defaultView |
1381 | 1354 | for="lp.registry.interfaces.product.IProduct" | 1354 | for="lp.registry.interfaces.product.IProduct" |
1382 | 1355 | name="+specs" | 1355 | name="+specs" |
1384 | 1356 | layer="canonical.launchpad.layers.BlueprintLayer"/> | 1356 | layer="lp.blueprints.publisher.BlueprintsLayer"/> |
1385 | 1357 | <browser:defaultView | 1357 | <browser:defaultView |
1386 | 1358 | for="lp.registry.interfaces.product.IProduct" | 1358 | for="lp.registry.interfaces.product.IProduct" |
1387 | 1359 | name="+code-index" | 1359 | name="+code-index" |
1388 | 1360 | layer="lp.code.publisher.CodeLayer"/> | 1360 | layer="lp.code.publisher.CodeLayer"/> |
1389 | 1361 | <browser:defaultView | 1361 | <browser:defaultView |
1390 | 1362 | for="lp.registry.interfaces.product.IProduct" | 1362 | for="lp.registry.interfaces.product.IProduct" |
1392 | 1363 | layer="canonical.launchpad.layers.AnswersLayer" | 1363 | layer="lp.answers.publisher.AnswersLayer" |
1393 | 1364 | name="+questions"/> | 1364 | name="+questions"/> |
1394 | 1365 | <browser:defaultView | 1365 | <browser:defaultView |
1395 | 1366 | for="lp.registry.interfaces.product.IProduct" | 1366 | for="lp.registry.interfaces.product.IProduct" |
1397 | 1367 | layer="canonical.launchpad.layers.BugsLayer" | 1367 | layer="lp.bugs.publisher.BugsLayer" |
1398 | 1368 | name="+bugs-index"/> | 1368 | name="+bugs-index"/> |
1399 | 1369 | <browser:navigation | 1369 | <browser:navigation |
1400 | 1370 | module="lp.registry.browser.product" | 1370 | module="lp.registry.browser.product" |
1401 | @@ -1596,10 +1596,10 @@ | |||
1402 | 1596 | <browser:defaultView | 1596 | <browser:defaultView |
1403 | 1597 | for="lp.registry.interfaces.productseries.IProductSeries" | 1597 | for="lp.registry.interfaces.productseries.IProductSeries" |
1404 | 1598 | name="+specs" | 1598 | name="+specs" |
1406 | 1599 | layer="canonical.launchpad.layers.BlueprintLayer"/> | 1599 | layer="lp.blueprints.publisher.BlueprintsLayer"/> |
1407 | 1600 | <browser:defaultView | 1600 | <browser:defaultView |
1408 | 1601 | for="lp.registry.interfaces.productseries.IProductSeries" | 1601 | for="lp.registry.interfaces.productseries.IProductSeries" |
1410 | 1602 | layer="canonical.launchpad.layers.BugsLayer" | 1602 | layer="lp.bugs.publisher.BugsLayer" |
1411 | 1603 | name="+bugs-index"/> | 1603 | name="+bugs-index"/> |
1412 | 1604 | <browser:page | 1604 | <browser:page |
1413 | 1605 | name="+get-involved" | 1605 | name="+get-involved" |
1414 | @@ -1739,14 +1739,14 @@ | |||
1415 | 1739 | <browser:defaultView | 1739 | <browser:defaultView |
1416 | 1740 | for="lp.registry.interfaces.distribution.IDistribution" | 1740 | for="lp.registry.interfaces.distribution.IDistribution" |
1417 | 1741 | name="+specs" | 1741 | name="+specs" |
1419 | 1742 | layer="canonical.launchpad.layers.BlueprintLayer"/> | 1742 | layer="lp.blueprints.publisher.BlueprintsLayer"/> |
1420 | 1743 | <browser:defaultView | 1743 | <browser:defaultView |
1421 | 1744 | for="lp.registry.interfaces.distribution.IDistribution" | 1744 | for="lp.registry.interfaces.distribution.IDistribution" |
1423 | 1745 | layer="canonical.launchpad.layers.BugsLayer" | 1745 | layer="lp.bugs.publisher.BugsLayer" |
1424 | 1746 | name="+bugs-index"/> | 1746 | name="+bugs-index"/> |
1425 | 1747 | <browser:defaultView | 1747 | <browser:defaultView |
1426 | 1748 | for="lp.registry.interfaces.distribution.IDistribution" | 1748 | for="lp.registry.interfaces.distribution.IDistribution" |
1428 | 1749 | layer="canonical.launchpad.layers.AnswersLayer" | 1749 | layer="lp.answers.publisher.AnswersLayer" |
1429 | 1750 | name="+questions"/> | 1750 | name="+questions"/> |
1430 | 1751 | <browser:navigation | 1751 | <browser:navigation |
1431 | 1752 | module="lp.registry.browser.distribution" | 1752 | module="lp.registry.browser.distribution" |
1432 | @@ -1946,11 +1946,11 @@ | |||
1433 | 1946 | name="+index"/> | 1946 | name="+index"/> |
1434 | 1947 | <browser:defaultView | 1947 | <browser:defaultView |
1435 | 1948 | for="lp.registry.interfaces.sourcepackage.ISourcePackage" | 1948 | for="lp.registry.interfaces.sourcepackage.ISourcePackage" |
1437 | 1949 | layer="canonical.launchpad.layers.BugsLayer" | 1949 | layer="lp.bugs.publisher.BugsLayer" |
1438 | 1950 | name="+bugs"/> | 1950 | name="+bugs"/> |
1439 | 1951 | <browser:defaultView | 1951 | <browser:defaultView |
1440 | 1952 | for="lp.registry.interfaces.sourcepackage.ISourcePackage" | 1952 | for="lp.registry.interfaces.sourcepackage.ISourcePackage" |
1442 | 1953 | layer="canonical.launchpad.layers.AnswersLayer" | 1953 | layer="lp.answers.publisher.AnswersLayer" |
1443 | 1954 | name="+questions"/> | 1954 | name="+questions"/> |
1444 | 1955 | <browser:navigation | 1955 | <browser:navigation |
1445 | 1956 | module="lp.registry.browser.sourcepackage" | 1956 | module="lp.registry.browser.sourcepackage" |
1446 | 1957 | 1957 | ||
1447 | === modified file 'lib/lp/translations/browser/configure.zcml' | |||
1448 | --- lib/lp/translations/browser/configure.zcml 2010-04-19 08:11:52 +0000 | |||
1449 | +++ lib/lp/translations/browser/configure.zcml 2010-07-22 20:59:01 +0000 | |||
1450 | @@ -15,7 +15,7 @@ | |||
1451 | 15 | <browser:defaultView | 15 | <browser:defaultView |
1452 | 16 | for="canonical.launchpad.interfaces.IRosettaApplication" | 16 | for="canonical.launchpad.interfaces.IRosettaApplication" |
1453 | 17 | name="+index" | 17 | name="+index" |
1455 | 18 | layer="canonical.launchpad.layers.TranslationsLayer"/> | 18 | layer="lp.translations.publisher.TranslationsLayer"/> |
1456 | 19 | <browser:navigation | 19 | <browser:navigation |
1457 | 20 | module="lp.translations.browser.translations" | 20 | module="lp.translations.browser.translations" |
1458 | 21 | classes=" | 21 | classes=" |
1459 | @@ -25,7 +25,7 @@ | |||
1460 | 25 | facet="translations" | 25 | facet="translations" |
1461 | 26 | permission="zope.Public" | 26 | permission="zope.Public" |
1462 | 27 | class="lp.translations.browser.translations.RosettaApplicationView" | 27 | class="lp.translations.browser.translations.RosettaApplicationView" |
1464 | 28 | layer="canonical.launchpad.layers.TranslationsLayer"> | 28 | layer="lp.translations.publisher.TranslationsLayer"> |
1465 | 29 | <browser:page | 29 | <browser:page |
1466 | 30 | name="+index" | 30 | name="+index" |
1467 | 31 | template="../templates/rosetta-index.pt"/> | 31 | template="../templates/rosetta-index.pt"/> |
1468 | @@ -44,7 +44,7 @@ | |||
1469 | 44 | facet="translations" | 44 | facet="translations" |
1470 | 45 | permission="zope.Public" | 45 | permission="zope.Public" |
1471 | 46 | class="lp.translations.browser.translations.TranslatableProductsView" | 46 | class="lp.translations.browser.translations.TranslatableProductsView" |
1473 | 47 | layer="canonical.launchpad.layers.TranslationsLayer" | 47 | layer="lp.translations.publisher.TranslationsLayer" |
1474 | 48 | name="+products-with-translations" | 48 | name="+products-with-translations" |
1475 | 49 | template="../templates/rosetta-products.pt"/> | 49 | template="../templates/rosetta-products.pt"/> |
1476 | 50 | <browser:pages | 50 | <browser:pages |
1477 | @@ -66,48 +66,48 @@ | |||
1478 | 66 | permission="zope.Public" | 66 | permission="zope.Public" |
1479 | 67 | name="+barchart" | 67 | name="+barchart" |
1480 | 68 | template="../templates/rosettastats-barchart.pt" | 68 | template="../templates/rosettastats-barchart.pt" |
1482 | 69 | layer="canonical.launchpad.layers.TranslationsLayer"/> | 69 | layer="lp.translations.publisher.TranslationsLayer"/> |
1483 | 70 | <browser:page | 70 | <browser:page |
1484 | 71 | for="*" | 71 | for="*" |
1485 | 72 | name="+translations-macros" | 72 | name="+translations-macros" |
1486 | 73 | facet="translations" | 73 | facet="translations" |
1487 | 74 | permission="zope.Public" | 74 | permission="zope.Public" |
1488 | 75 | template="../templates/translations-macros.pt" | 75 | template="../templates/translations-macros.pt" |
1490 | 76 | layer="canonical.launchpad.layers.TranslationsLayer"/> | 76 | layer="lp.translations.publisher.TranslationsLayer"/> |
1491 | 77 | <browser:page | 77 | <browser:page |
1492 | 78 | for="lp.translations.interfaces.translationgroup.ITranslationPolicy" | 78 | for="lp.translations.interfaces.translationgroup.ITranslationPolicy" |
1493 | 79 | facet="translations" | 79 | facet="translations" |
1494 | 80 | permission="zope.Public" | 80 | permission="zope.Public" |
1495 | 81 | name="+portlet-translation-groups-and-permission" | 81 | name="+portlet-translation-groups-and-permission" |
1496 | 82 | template="../templates/hastranslationgroup-portlet-translation-groups-and-permission.pt" | 82 | template="../templates/hastranslationgroup-portlet-translation-groups-and-permission.pt" |
1498 | 83 | layer="canonical.launchpad.layers.TranslationsLayer"/> | 83 | layer="lp.translations.publisher.TranslationsLayer"/> |
1499 | 84 | <facet | 84 | <facet |
1500 | 85 | facet="translations"> | 85 | facet="translations"> |
1501 | 86 | <browser:defaultView | 86 | <browser:defaultView |
1502 | 87 | for="lp.translations.interfaces.translator.ITranslator" | 87 | for="lp.translations.interfaces.translator.ITranslator" |
1503 | 88 | name="+admin" | 88 | name="+admin" |
1505 | 89 | layer="canonical.launchpad.layers.TranslationsLayer"/> | 89 | layer="lp.translations.publisher.TranslationsLayer"/> |
1506 | 90 | <browser:page | 90 | <browser:page |
1507 | 91 | name="+admin" | 91 | name="+admin" |
1508 | 92 | for="lp.translations.interfaces.translator.ITranslator" | 92 | for="lp.translations.interfaces.translator.ITranslator" |
1509 | 93 | permission="launchpad.Admin" | 93 | permission="launchpad.Admin" |
1510 | 94 | class="lp.translations.browser.translator.TranslatorAdminView" | 94 | class="lp.translations.browser.translator.TranslatorAdminView" |
1511 | 95 | template="../../app/templates/generic-edit.pt" | 95 | template="../../app/templates/generic-edit.pt" |
1513 | 96 | layer="canonical.launchpad.layers.TranslationsLayer"/> | 96 | layer="lp.translations.publisher.TranslationsLayer"/> |
1514 | 97 | <browser:page | 97 | <browser:page |
1515 | 98 | name="+edit" | 98 | name="+edit" |
1516 | 99 | for="lp.translations.interfaces.translator.IEditTranslator" | 99 | for="lp.translations.interfaces.translator.IEditTranslator" |
1517 | 100 | permission="launchpad.Edit" | 100 | permission="launchpad.Edit" |
1518 | 101 | class="lp.translations.browser.translator.TranslatorEditView" | 101 | class="lp.translations.browser.translator.TranslatorEditView" |
1519 | 102 | template="../../app/templates/generic-edit.pt" | 102 | template="../../app/templates/generic-edit.pt" |
1521 | 103 | layer="canonical.launchpad.layers.TranslationsLayer"/> | 103 | layer="lp.translations.publisher.TranslationsLayer"/> |
1522 | 104 | <browser:page | 104 | <browser:page |
1523 | 105 | name="+remove" | 105 | name="+remove" |
1524 | 106 | for="lp.translations.interfaces.translator.ITranslator" | 106 | for="lp.translations.interfaces.translator.ITranslator" |
1525 | 107 | permission="launchpad.Edit" | 107 | permission="launchpad.Edit" |
1526 | 108 | class="lp.translations.browser.translator.TranslatorRemoveView" | 108 | class="lp.translations.browser.translator.TranslatorRemoveView" |
1527 | 109 | template="../../app/templates/generic-edit.pt" | 109 | template="../../app/templates/generic-edit.pt" |
1529 | 110 | layer="canonical.launchpad.layers.TranslationsLayer"/> | 110 | layer="lp.translations.publisher.TranslationsLayer"/> |
1530 | 111 | </facet> | 111 | </facet> |
1531 | 112 | <facet | 112 | <facet |
1532 | 113 | facet="translations"> | 113 | facet="translations"> |
1533 | @@ -119,7 +119,7 @@ | |||
1534 | 119 | <browser:defaultView | 119 | <browser:defaultView |
1535 | 120 | for="lp.translations.interfaces.translationimportqueue.ITranslationImportQueueEntry" | 120 | for="lp.translations.interfaces.translationimportqueue.ITranslationImportQueueEntry" |
1536 | 121 | name="+index" | 121 | name="+index" |
1538 | 122 | layer="canonical.launchpad.layers.TranslationsLayer"/> | 122 | layer="lp.translations.publisher.TranslationsLayer"/> |
1539 | 123 | <browser:url | 123 | <browser:url |
1540 | 124 | for="lp.translations.interfaces.translationimportqueue.ITranslationImportQueueEntry" | 124 | for="lp.translations.interfaces.translationimportqueue.ITranslationImportQueueEntry" |
1541 | 125 | path_expression="string:${id}" | 125 | path_expression="string:${id}" |
1542 | @@ -130,12 +130,12 @@ | |||
1543 | 130 | class="lp.translations.browser.translationimportqueue.TranslationImportQueueEntryView" | 130 | class="lp.translations.browser.translationimportqueue.TranslationImportQueueEntryView" |
1544 | 131 | permission="launchpad.Admin" | 131 | permission="launchpad.Admin" |
1545 | 132 | template="../templates/translationimportqueueentry-index.pt" | 132 | template="../templates/translationimportqueueentry-index.pt" |
1547 | 133 | layer="canonical.launchpad.layers.TranslationsLayer"/> | 133 | layer="lp.translations.publisher.TranslationsLayer"/> |
1548 | 134 | <browser:page | 134 | <browser:page |
1549 | 135 | for="lp.translations.interfaces.translationimportqueue.ITranslationImportQueueEntry" | 135 | for="lp.translations.interfaces.translationimportqueue.ITranslationImportQueueEntry" |
1550 | 136 | facet="translations" | 136 | facet="translations" |
1551 | 137 | permission="zope.Public" | 137 | permission="zope.Public" |
1553 | 138 | layer="canonical.launchpad.layers.TranslationsLayer" | 138 | layer="lp.translations.publisher.TranslationsLayer" |
1554 | 139 | name="+portlet-details" | 139 | name="+portlet-details" |
1555 | 140 | class="lp.translations.browser.translationimportqueue.TranslationImportQueueEntryView" | 140 | class="lp.translations.browser.translationimportqueue.TranslationImportQueueEntryView" |
1556 | 141 | template="../templates/translationimportqueueentry-portlet-details.pt"/> | 141 | template="../templates/translationimportqueueentry-portlet-details.pt"/> |
1557 | @@ -146,7 +146,7 @@ | |||
1558 | 146 | <browser:defaultView | 146 | <browser:defaultView |
1559 | 147 | for="lp.translations.interfaces.translationimportqueue.ITranslationImportQueue" | 147 | for="lp.translations.interfaces.translationimportqueue.ITranslationImportQueue" |
1560 | 148 | name="+index" | 148 | name="+index" |
1562 | 149 | layer="canonical.launchpad.layers.TranslationsLayer"/> | 149 | layer="lp.translations.publisher.TranslationsLayer"/> |
1563 | 150 | <browser:page | 150 | <browser:page |
1564 | 151 | for="lp.translations.interfaces.translationimportqueue.ITranslationImportQueue" | 151 | for="lp.translations.interfaces.translationimportqueue.ITranslationImportQueue" |
1565 | 152 | name="+index" | 152 | name="+index" |
1566 | @@ -154,7 +154,7 @@ | |||
1567 | 154 | facet="translations" | 154 | facet="translations" |
1568 | 155 | permission="zope.Public" | 155 | permission="zope.Public" |
1569 | 156 | template="../templates/translationimportqueue-index.pt" | 156 | template="../templates/translationimportqueue-index.pt" |
1571 | 157 | layer="canonical.launchpad.layers.TranslationsLayer"/> | 157 | layer="lp.translations.publisher.TranslationsLayer"/> |
1572 | 158 | </facet> | 158 | </facet> |
1573 | 159 | <browser:url | 159 | <browser:url |
1574 | 160 | for="lp.translations.interfaces.distroserieslanguage.IDistroSeriesLanguage" | 160 | for="lp.translations.interfaces.distroserieslanguage.IDistroSeriesLanguage" |
1575 | @@ -167,12 +167,12 @@ | |||
1576 | 167 | <browser:defaultView | 167 | <browser:defaultView |
1577 | 168 | for="lp.translations.interfaces.distroserieslanguage.IDistroSeriesLanguage" | 168 | for="lp.translations.interfaces.distroserieslanguage.IDistroSeriesLanguage" |
1578 | 169 | name="+index" | 169 | name="+index" |
1580 | 170 | layer="canonical.launchpad.layers.TranslationsLayer"/> | 170 | layer="lp.translations.publisher.TranslationsLayer"/> |
1581 | 171 | <browser:pages | 171 | <browser:pages |
1582 | 172 | for="lp.translations.interfaces.distroserieslanguage.IDistroSeriesLanguage" | 172 | for="lp.translations.interfaces.distroserieslanguage.IDistroSeriesLanguage" |
1583 | 173 | permission="zope.Public" | 173 | permission="zope.Public" |
1584 | 174 | facet="translations" | 174 | facet="translations" |
1586 | 175 | layer="canonical.launchpad.layers.TranslationsLayer"> | 175 | layer="lp.translations.publisher.TranslationsLayer"> |
1587 | 176 | <browser:page | 176 | <browser:page |
1588 | 177 | name="+rosetta-status-legend" | 177 | name="+rosetta-status-legend" |
1589 | 178 | template="../templates/rosetta-status-legend.pt"/> | 178 | template="../templates/rosetta-status-legend.pt"/> |
1590 | @@ -184,7 +184,7 @@ | |||
1591 | 184 | template="../templates/serieslanguage-index.pt" | 184 | template="../templates/serieslanguage-index.pt" |
1592 | 185 | class="lp.translations.browser.serieslanguage.DistroSeriesLanguageView" | 185 | class="lp.translations.browser.serieslanguage.DistroSeriesLanguageView" |
1593 | 186 | facet="translations" | 186 | facet="translations" |
1595 | 187 | layer="canonical.launchpad.layers.TranslationsLayer"/> | 187 | layer="lp.translations.publisher.TranslationsLayer"/> |
1596 | 188 | <facet | 188 | <facet |
1597 | 189 | facet="translations"> | 189 | facet="translations"> |
1598 | 190 | <browser:navigation | 190 | <browser:navigation |
1599 | @@ -204,19 +204,19 @@ | |||
1600 | 204 | <browser:defaultView | 204 | <browser:defaultView |
1601 | 205 | for="lp.translations.interfaces.pofile.IPOFile" | 205 | for="lp.translations.interfaces.pofile.IPOFile" |
1602 | 206 | name="+translate" | 206 | name="+translate" |
1604 | 207 | layer="canonical.launchpad.layers.TranslationsLayer"/> | 207 | layer="lp.translations.publisher.TranslationsLayer"/> |
1605 | 208 | <browser:page | 208 | <browser:page |
1606 | 209 | for="lp.translations.interfaces.pofile.IPOFile" | 209 | for="lp.translations.interfaces.pofile.IPOFile" |
1607 | 210 | name="+details" | 210 | name="+details" |
1608 | 211 | permission="zope.Public" | 211 | permission="zope.Public" |
1609 | 212 | class="lp.translations.browser.pofile.POFileDetailsView" | 212 | class="lp.translations.browser.pofile.POFileDetailsView" |
1611 | 213 | layer="canonical.launchpad.layers.TranslationsLayer" | 213 | layer="lp.translations.publisher.TranslationsLayer" |
1612 | 214 | template="../templates/pofile-details.pt"/> | 214 | template="../templates/pofile-details.pt"/> |
1613 | 215 | <browser:pages | 215 | <browser:pages |
1614 | 216 | for="lp.translations.interfaces.pofile.IPOFile" | 216 | for="lp.translations.interfaces.pofile.IPOFile" |
1615 | 217 | permission="zope.Public" | 217 | permission="zope.Public" |
1616 | 218 | class="lp.translations.browser.pofile.POFileView" | 218 | class="lp.translations.browser.pofile.POFileView" |
1618 | 219 | layer="canonical.launchpad.layers.TranslationsLayer"> | 219 | layer="lp.translations.publisher.TranslationsLayer"> |
1619 | 220 | <!-- POFile Portlets --> | 220 | <!-- POFile Portlets --> |
1620 | 221 | <browser:page | 221 | <browser:page |
1621 | 222 | name="+contributors" | 222 | name="+contributors" |
1622 | @@ -237,7 +237,7 @@ | |||
1623 | 237 | class="lp.translations.browser.pofile.POFileUploadView" | 237 | class="lp.translations.browser.pofile.POFileUploadView" |
1624 | 238 | for="lp.translations.interfaces.pofile.IPOFile" | 238 | for="lp.translations.interfaces.pofile.IPOFile" |
1625 | 239 | template="../templates/pofile-upload.pt" | 239 | template="../templates/pofile-upload.pt" |
1627 | 240 | layer="canonical.launchpad.layers.TranslationsLayer"/> | 240 | layer="lp.translations.publisher.TranslationsLayer"/> |
1628 | 241 | <browser:page | 241 | <browser:page |
1629 | 242 | name="+translate" | 242 | name="+translate" |
1630 | 243 | for="lp.translations.interfaces.pofile.IPOFile" | 243 | for="lp.translations.interfaces.pofile.IPOFile" |
1631 | @@ -250,21 +250,21 @@ | |||
1632 | 250 | permission="zope.Public" | 250 | permission="zope.Public" |
1633 | 251 | template="../templates/pofile-translate.pt" | 251 | template="../templates/pofile-translate.pt" |
1634 | 252 | class="lp.translations.browser.pofile.POFileTranslateView" | 252 | class="lp.translations.browser.pofile.POFileTranslateView" |
1636 | 253 | layer="canonical.launchpad.layers.TranslationsLayer"/> | 253 | layer="lp.translations.publisher.TranslationsLayer"/> |
1637 | 254 | <browser:page | 254 | <browser:page |
1638 | 255 | name="+export" | 255 | name="+export" |
1639 | 256 | for="lp.translations.interfaces.pofile.IPOFile" | 256 | for="lp.translations.interfaces.pofile.IPOFile" |
1640 | 257 | permission="launchpad.AnyPerson" | 257 | permission="launchpad.AnyPerson" |
1641 | 258 | template="../templates/pofile-export.pt" | 258 | template="../templates/pofile-export.pt" |
1642 | 259 | class="lp.translations.browser.pofile.POExportView" | 259 | class="lp.translations.browser.pofile.POExportView" |
1644 | 260 | layer="canonical.launchpad.layers.TranslationsLayer"/> | 260 | layer="lp.translations.publisher.TranslationsLayer"/> |
1645 | 261 | <browser:page | 261 | <browser:page |
1646 | 262 | name="+filter" | 262 | name="+filter" |
1647 | 263 | for="lp.translations.interfaces.pofile.IPOFile" | 263 | for="lp.translations.interfaces.pofile.IPOFile" |
1648 | 264 | permission="zope.Public" | 264 | permission="zope.Public" |
1649 | 265 | template="../templates/pofile-filter.pt" | 265 | template="../templates/pofile-filter.pt" |
1650 | 266 | class="lp.translations.browser.pofile.POFileFilteredView" | 266 | class="lp.translations.browser.pofile.POFileFilteredView" |
1652 | 267 | layer="canonical.launchpad.layers.TranslationsLayer"/> | 267 | layer="lp.translations.publisher.TranslationsLayer"/> |
1653 | 268 | </facet> | 268 | </facet> |
1654 | 269 | <browser:url | 269 | <browser:url |
1655 | 270 | for="lp.translations.interfaces.productserieslanguage.IProductSeriesLanguage" | 270 | for="lp.translations.interfaces.productserieslanguage.IProductSeriesLanguage" |
1656 | @@ -282,7 +282,7 @@ | |||
1657 | 282 | for="lp.translations.interfaces.productserieslanguage.IProductSeriesLanguage" | 282 | for="lp.translations.interfaces.productserieslanguage.IProductSeriesLanguage" |
1658 | 283 | permission="zope.Public" | 283 | permission="zope.Public" |
1659 | 284 | facet="translations" | 284 | facet="translations" |
1661 | 285 | layer="canonical.launchpad.layers.TranslationsLayer"> | 285 | layer="lp.translations.publisher.TranslationsLayer"> |
1662 | 286 | <browser:page | 286 | <browser:page |
1663 | 287 | name="+rosetta-status-legend" | 287 | name="+rosetta-status-legend" |
1664 | 288 | template="../templates/rosetta-status-legend.pt"/> | 288 | template="../templates/rosetta-status-legend.pt"/> |
1665 | @@ -294,7 +294,7 @@ | |||
1666 | 294 | template="../templates/serieslanguage-index.pt" | 294 | template="../templates/serieslanguage-index.pt" |
1667 | 295 | class="lp.translations.browser.serieslanguage.ProductSeriesLanguageView" | 295 | class="lp.translations.browser.serieslanguage.ProductSeriesLanguageView" |
1668 | 296 | facet="translations" | 296 | facet="translations" |
1670 | 297 | layer="canonical.launchpad.layers.TranslationsLayer"/> | 297 | layer="lp.translations.publisher.TranslationsLayer"/> |
1671 | 298 | <facet | 298 | <facet |
1672 | 299 | facet="translations"> | 299 | facet="translations"> |
1673 | 300 | <browser:navigation | 300 | <browser:navigation |
1674 | @@ -304,7 +304,7 @@ | |||
1675 | 304 | <browser:defaultView | 304 | <browser:defaultView |
1676 | 305 | for="canonical.launchpad.interfaces.ILanguage" | 305 | for="canonical.launchpad.interfaces.ILanguage" |
1677 | 306 | name="+index" | 306 | name="+index" |
1679 | 307 | layer="canonical.launchpad.layers.TranslationsLayer"/> | 307 | layer="lp.translations.publisher.TranslationsLayer"/> |
1680 | 308 | <browser:menus | 308 | <browser:menus |
1681 | 309 | module="lp.translations.browser.language" | 309 | module="lp.translations.browser.language" |
1682 | 310 | classes=" | 310 | classes=" |
1683 | @@ -321,19 +321,19 @@ | |||
1684 | 321 | permission="zope.Public" | 321 | permission="zope.Public" |
1685 | 322 | template="../templates/language-index.pt" | 322 | template="../templates/language-index.pt" |
1686 | 323 | name="+index" | 323 | name="+index" |
1688 | 324 | layer="canonical.launchpad.layers.TranslationsLayer"/> | 324 | layer="lp.translations.publisher.TranslationsLayer"/> |
1689 | 325 | <browser:page | 325 | <browser:page |
1690 | 326 | for="canonical.launchpad.interfaces.ILanguage" | 326 | for="canonical.launchpad.interfaces.ILanguage" |
1691 | 327 | class="lp.translations.browser.language.LanguageAdminView" | 327 | class="lp.translations.browser.language.LanguageAdminView" |
1692 | 328 | permission="launchpad.Admin" | 328 | permission="launchpad.Admin" |
1693 | 329 | template="../../app/templates/generic-edit.pt" | 329 | template="../../app/templates/generic-edit.pt" |
1694 | 330 | name="+admin" | 330 | name="+admin" |
1696 | 331 | layer="canonical.launchpad.layers.TranslationsLayer"/> | 331 | layer="lp.translations.publisher.TranslationsLayer"/> |
1697 | 332 | <browser:pages | 332 | <browser:pages |
1698 | 333 | for="canonical.launchpad.interfaces.ILanguage" | 333 | for="canonical.launchpad.interfaces.ILanguage" |
1699 | 334 | class="lp.translations.browser.language.LanguageView" | 334 | class="lp.translations.browser.language.LanguageView" |
1700 | 335 | permission="zope.Public" | 335 | permission="zope.Public" |
1702 | 336 | layer="canonical.launchpad.layers.TranslationsLayer"> | 336 | layer="lp.translations.publisher.TranslationsLayer"> |
1703 | 337 | <browser:page | 337 | <browser:page |
1704 | 338 | name="+portlet-details" | 338 | name="+portlet-details" |
1705 | 339 | template="../templates/language-portlet-details.pt"/> | 339 | template="../templates/language-portlet-details.pt"/> |
1706 | @@ -344,7 +344,7 @@ | |||
1707 | 344 | <browser:defaultView | 344 | <browser:defaultView |
1708 | 345 | for="canonical.launchpad.interfaces.ILanguageSet" | 345 | for="canonical.launchpad.interfaces.ILanguageSet" |
1709 | 346 | name="+index" | 346 | name="+index" |
1711 | 347 | layer="canonical.launchpad.layers.TranslationsLayer"/> | 347 | layer="lp.translations.publisher.TranslationsLayer"/> |
1712 | 348 | <browser:url | 348 | <browser:url |
1713 | 349 | for="canonical.launchpad.interfaces.ILanguageSet" | 349 | for="canonical.launchpad.interfaces.ILanguageSet" |
1714 | 350 | path_expression="string:+languages" | 350 | path_expression="string:+languages" |
1715 | @@ -356,14 +356,14 @@ | |||
1716 | 356 | permission="zope.Public" | 356 | permission="zope.Public" |
1717 | 357 | template="../templates/languageset-index.pt" | 357 | template="../templates/languageset-index.pt" |
1718 | 358 | name="+index" | 358 | name="+index" |
1720 | 359 | layer="canonical.launchpad.layers.TranslationsLayer"/> | 359 | layer="lp.translations.publisher.TranslationsLayer"/> |
1721 | 360 | <browser:page | 360 | <browser:page |
1722 | 361 | for="canonical.launchpad.interfaces.ILanguageSet" | 361 | for="canonical.launchpad.interfaces.ILanguageSet" |
1723 | 362 | class="lp.translations.browser.language.LanguageAddView" | 362 | class="lp.translations.browser.language.LanguageAddView" |
1724 | 363 | permission="launchpad.Admin" | 363 | permission="launchpad.Admin" |
1725 | 364 | template="../../app/templates/generic-edit.pt" | 364 | template="../../app/templates/generic-edit.pt" |
1726 | 365 | name="+add" | 365 | name="+add" |
1728 | 366 | layer="canonical.launchpad.layers.TranslationsLayer"/> | 366 | layer="lp.translations.publisher.TranslationsLayer"/> |
1729 | 367 | <browser:navigation | 367 | <browser:navigation |
1730 | 368 | module="lp.translations.browser.potemplate" | 368 | module="lp.translations.browser.potemplate" |
1731 | 369 | classes=" | 369 | classes=" |
1732 | @@ -373,19 +373,19 @@ | |||
1733 | 373 | <browser:defaultView | 373 | <browser:defaultView |
1734 | 374 | for="lp.translations.interfaces.potemplate.IPOTemplate" | 374 | for="lp.translations.interfaces.potemplate.IPOTemplate" |
1735 | 375 | name="+index" | 375 | name="+index" |
1737 | 376 | layer="canonical.launchpad.layers.TranslationsLayer"/> | 376 | layer="lp.translations.publisher.TranslationsLayer"/> |
1738 | 377 | <browser:page | 377 | <browser:page |
1739 | 378 | name="+preferred-chart" | 378 | name="+preferred-chart" |
1740 | 379 | for="lp.translations.interfaces.potemplate.IPOTemplate" | 379 | for="lp.translations.interfaces.potemplate.IPOTemplate" |
1741 | 380 | class="lp.translations.browser.potemplate.POTemplateViewPreferred" | 380 | class="lp.translations.browser.potemplate.POTemplateViewPreferred" |
1742 | 381 | permission="zope.Public" | 381 | permission="zope.Public" |
1743 | 382 | template="../templates/potemplate-chart.pt" | 382 | template="../templates/potemplate-chart.pt" |
1745 | 383 | layer="canonical.launchpad.layers.TranslationsLayer"/> | 383 | layer="lp.translations.publisher.TranslationsLayer"/> |
1746 | 384 | <browser:pages | 384 | <browser:pages |
1747 | 385 | for="lp.translations.interfaces.potemplate.IPOTemplate" | 385 | for="lp.translations.interfaces.potemplate.IPOTemplate" |
1748 | 386 | class="lp.translations.browser.potemplate.POTemplateView" | 386 | class="lp.translations.browser.potemplate.POTemplateView" |
1749 | 387 | permission="zope.Public" | 387 | permission="zope.Public" |
1751 | 388 | layer="canonical.launchpad.layers.TranslationsLayer"> | 388 | layer="lp.translations.publisher.TranslationsLayer"> |
1752 | 389 | <browser:page | 389 | <browser:page |
1753 | 390 | name="+index" | 390 | name="+index" |
1754 | 391 | template="../templates/potemplate-index.pt"/> | 391 | template="../templates/potemplate-index.pt"/> |
1755 | @@ -408,28 +408,28 @@ | |||
1756 | 408 | permission="launchpad.Edit" | 408 | permission="launchpad.Edit" |
1757 | 409 | template="../templates/potemplate-upload.pt" | 409 | template="../templates/potemplate-upload.pt" |
1758 | 410 | class="lp.translations.browser.potemplate.POTemplateUploadView" | 410 | class="lp.translations.browser.potemplate.POTemplateUploadView" |
1760 | 411 | layer="canonical.launchpad.layers.TranslationsLayer"/> | 411 | layer="lp.translations.publisher.TranslationsLayer"/> |
1761 | 412 | <browser:page | 412 | <browser:page |
1762 | 413 | name="+edit" | 413 | name="+edit" |
1763 | 414 | for="lp.translations.interfaces.potemplate.IPOTemplate" | 414 | for="lp.translations.interfaces.potemplate.IPOTemplate" |
1764 | 415 | class="lp.translations.browser.potemplate.POTemplateEditView" | 415 | class="lp.translations.browser.potemplate.POTemplateEditView" |
1765 | 416 | permission="launchpad.Edit" | 416 | permission="launchpad.Edit" |
1766 | 417 | template="../../app/templates/generic-edit.pt" | 417 | template="../../app/templates/generic-edit.pt" |
1768 | 418 | layer="canonical.launchpad.layers.TranslationsLayer"/> | 418 | layer="lp.translations.publisher.TranslationsLayer"/> |
1769 | 419 | <browser:page | 419 | <browser:page |
1770 | 420 | name="+admin" | 420 | name="+admin" |
1771 | 421 | for="lp.translations.interfaces.potemplate.IPOTemplate" | 421 | for="lp.translations.interfaces.potemplate.IPOTemplate" |
1772 | 422 | class="lp.translations.browser.potemplate.POTemplateAdminView" | 422 | class="lp.translations.browser.potemplate.POTemplateAdminView" |
1773 | 423 | permission="launchpad.TranslationsAdmin" | 423 | permission="launchpad.TranslationsAdmin" |
1774 | 424 | template="../../app/templates/generic-edit.pt" | 424 | template="../../app/templates/generic-edit.pt" |
1776 | 425 | layer="canonical.launchpad.layers.TranslationsLayer"/> | 425 | layer="lp.translations.publisher.TranslationsLayer"/> |
1777 | 426 | <browser:page | 426 | <browser:page |
1778 | 427 | name="+export" | 427 | name="+export" |
1779 | 428 | for="lp.translations.interfaces.potemplate.IPOTemplate" | 428 | for="lp.translations.interfaces.potemplate.IPOTemplate" |
1780 | 429 | permission="launchpad.AnyPerson" | 429 | permission="launchpad.AnyPerson" |
1781 | 430 | template="../templates/potemplate-export.pt" | 430 | template="../templates/potemplate-export.pt" |
1782 | 431 | class="lp.translations.browser.potemplate.POTemplateExportView" | 431 | class="lp.translations.browser.potemplate.POTemplateExportView" |
1784 | 432 | layer="canonical.launchpad.layers.TranslationsLayer"/> | 432 | layer="lp.translations.publisher.TranslationsLayer"/> |
1785 | 433 | <browser:menus | 433 | <browser:menus |
1786 | 434 | module="lp.translations.browser.potemplate" | 434 | module="lp.translations.browser.potemplate" |
1787 | 435 | classes=" | 435 | classes=" |
1788 | @@ -444,14 +444,14 @@ | |||
1789 | 444 | <browser:defaultView | 444 | <browser:defaultView |
1790 | 445 | for="lp.translations.interfaces.potemplate.IPOTemplateSubset" | 445 | for="lp.translations.interfaces.potemplate.IPOTemplateSubset" |
1791 | 446 | name="+index" | 446 | name="+index" |
1793 | 447 | layer="canonical.launchpad.layers.TranslationsLayer"/> | 447 | layer="lp.translations.publisher.TranslationsLayer"/> |
1794 | 448 | <browser:page | 448 | <browser:page |
1795 | 449 | name="+index" | 449 | name="+index" |
1796 | 450 | for="lp.translations.interfaces.potemplate.IPOTemplateSubset" | 450 | for="lp.translations.interfaces.potemplate.IPOTemplateSubset" |
1797 | 451 | permission="zope.Public" | 451 | permission="zope.Public" |
1798 | 452 | class="lp.translations.browser.potemplate.POTemplateSubsetView" | 452 | class="lp.translations.browser.potemplate.POTemplateSubsetView" |
1799 | 453 | attribute="__call__" | 453 | attribute="__call__" |
1801 | 454 | layer="canonical.launchpad.layers.TranslationsLayer"/> | 454 | layer="lp.translations.publisher.TranslationsLayer"/> |
1802 | 455 | <browser:navigation | 455 | <browser:navigation |
1803 | 456 | module="lp.translations.browser.translationgroup" | 456 | module="lp.translations.browser.translationgroup" |
1804 | 457 | classes=" | 457 | classes=" |
1805 | @@ -460,7 +460,7 @@ | |||
1806 | 460 | <browser:defaultView | 460 | <browser:defaultView |
1807 | 461 | for="lp.translations.interfaces.translationgroup.ITranslationGroup" | 461 | for="lp.translations.interfaces.translationgroup.ITranslationGroup" |
1808 | 462 | name="+index" | 462 | name="+index" |
1810 | 463 | layer="canonical.launchpad.layers.TranslationsLayer"/> | 463 | layer="lp.translations.publisher.TranslationsLayer"/> |
1811 | 464 | <browser:url | 464 | <browser:url |
1812 | 465 | for="lp.translations.interfaces.translationgroup.ITranslationGroup" | 465 | for="lp.translations.interfaces.translationgroup.ITranslationGroup" |
1813 | 466 | path_expression="name" | 466 | path_expression="name" |
1814 | @@ -470,7 +470,7 @@ | |||
1815 | 470 | for="lp.translations.interfaces.translationgroup.ITranslationGroup" | 470 | for="lp.translations.interfaces.translationgroup.ITranslationGroup" |
1816 | 471 | class="lp.translations.browser.translationgroup.TranslationGroupView" | 471 | class="lp.translations.browser.translationgroup.TranslationGroupView" |
1817 | 472 | permission="zope.Public" | 472 | permission="zope.Public" |
1819 | 473 | layer="canonical.launchpad.layers.TranslationsLayer"> | 473 | layer="lp.translations.publisher.TranslationsLayer"> |
1820 | 474 | <browser:page | 474 | <browser:page |
1821 | 475 | template="../templates/translationgroup-index.pt" | 475 | template="../templates/translationgroup-index.pt" |
1822 | 476 | name="+index"/> | 476 | name="+index"/> |
1823 | @@ -487,27 +487,27 @@ | |||
1824 | 487 | permission="launchpad.Edit" | 487 | permission="launchpad.Edit" |
1825 | 488 | class="lp.translations.browser.translationgroup.TranslationGroupEditView" | 488 | class="lp.translations.browser.translationgroup.TranslationGroupEditView" |
1826 | 489 | template="../../app/templates/generic-edit.pt" | 489 | template="../../app/templates/generic-edit.pt" |
1828 | 490 | layer="canonical.launchpad.layers.TranslationsLayer"/> | 490 | layer="lp.translations.publisher.TranslationsLayer"/> |
1829 | 491 | <browser:page | 491 | <browser:page |
1830 | 492 | name="+appoint" | 492 | name="+appoint" |
1831 | 493 | for="lp.translations.interfaces.translationgroup.ITranslationGroup" | 493 | for="lp.translations.interfaces.translationgroup.ITranslationGroup" |
1832 | 494 | permission="launchpad.Edit" | 494 | permission="launchpad.Edit" |
1833 | 495 | class="lp.translations.browser.translationgroup.TranslationGroupAddTranslatorView" | 495 | class="lp.translations.browser.translationgroup.TranslationGroupAddTranslatorView" |
1834 | 496 | template="../../app/templates/generic-edit.pt" | 496 | template="../../app/templates/generic-edit.pt" |
1836 | 497 | layer="canonical.launchpad.layers.TranslationsLayer"/> | 497 | layer="lp.translations.publisher.TranslationsLayer"/> |
1837 | 498 | <browser:page | 498 | <browser:page |
1838 | 499 | name="+reassign" | 499 | name="+reassign" |
1839 | 500 | for="lp.translations.interfaces.translationgroup.ITranslationGroup" | 500 | for="lp.translations.interfaces.translationgroup.ITranslationGroup" |
1840 | 501 | permission="launchpad.Edit" | 501 | permission="launchpad.Edit" |
1841 | 502 | class="lp.translations.browser.translationgroup.TranslationGroupReassignmentView" | 502 | class="lp.translations.browser.translationgroup.TranslationGroupReassignmentView" |
1842 | 503 | template="../templates/translationgroup-reassignment.pt" | 503 | template="../templates/translationgroup-reassignment.pt" |
1844 | 504 | layer="canonical.launchpad.layers.TranslationsLayer"/> | 504 | layer="lp.translations.publisher.TranslationsLayer"/> |
1845 | 505 | <browser:page | 505 | <browser:page |
1846 | 506 | for="*" | 506 | for="*" |
1847 | 507 | permission="launchpad.Edit" | 507 | permission="launchpad.Edit" |
1848 | 508 | name="+object-reassignment" | 508 | name="+object-reassignment" |
1849 | 509 | template="../../../canonical/launchpad/templates/object-reassignment.pt" | 509 | template="../../../canonical/launchpad/templates/object-reassignment.pt" |
1851 | 510 | layer="canonical.launchpad.layers.TranslationsLayer"/> | 510 | layer="lp.translations.publisher.TranslationsLayer"/> |
1852 | 511 | <browser:url | 511 | <browser:url |
1853 | 512 | for="lp.translations.interfaces.translationgroup.ITranslationGroupSet" | 512 | for="lp.translations.interfaces.translationgroup.ITranslationGroupSet" |
1854 | 513 | path_expression="string:+groups" | 513 | path_expression="string:+groups" |
1855 | @@ -516,21 +516,21 @@ | |||
1856 | 516 | <browser:defaultView | 516 | <browser:defaultView |
1857 | 517 | for="lp.translations.interfaces.translationgroup.ITranslationGroupSet" | 517 | for="lp.translations.interfaces.translationgroup.ITranslationGroupSet" |
1858 | 518 | name="+index" | 518 | name="+index" |
1860 | 519 | layer="canonical.launchpad.layers.TranslationsLayer"/> | 519 | layer="lp.translations.publisher.TranslationsLayer"/> |
1861 | 520 | <browser:page | 520 | <browser:page |
1862 | 521 | name="+new" | 521 | name="+new" |
1863 | 522 | for="lp.translations.interfaces.translationgroup.ITranslationGroupSet" | 522 | for="lp.translations.interfaces.translationgroup.ITranslationGroupSet" |
1864 | 523 | class="lp.translations.browser.translationgroup.TranslationGroupAddView" | 523 | class="lp.translations.browser.translationgroup.TranslationGroupAddView" |
1865 | 524 | permission="launchpad.Admin" | 524 | permission="launchpad.Admin" |
1866 | 525 | template="../../app/templates/generic-edit.pt" | 525 | template="../../app/templates/generic-edit.pt" |
1868 | 526 | layer="canonical.launchpad.layers.TranslationsLayer"/> | 526 | layer="lp.translations.publisher.TranslationsLayer"/> |
1869 | 527 | <browser:page | 527 | <browser:page |
1870 | 528 | for="lp.translations.interfaces.translationgroup.ITranslationGroupSet" | 528 | for="lp.translations.interfaces.translationgroup.ITranslationGroupSet" |
1871 | 529 | class="lp.translations.browser.translationgroup.TranslationGroupSetView" | 529 | class="lp.translations.browser.translationgroup.TranslationGroupSetView" |
1872 | 530 | permission="zope.Public" | 530 | permission="zope.Public" |
1873 | 531 | template="../templates/translationgroups-index.pt" | 531 | template="../templates/translationgroups-index.pt" |
1874 | 532 | name="+index" | 532 | name="+index" |
1876 | 533 | layer="canonical.launchpad.layers.TranslationsLayer"/> | 533 | layer="lp.translations.publisher.TranslationsLayer"/> |
1877 | 534 | <browser:url | 534 | <browser:url |
1878 | 535 | for="lp.translations.interfaces.translationmessage.ITranslationMessage" | 535 | for="lp.translations.interfaces.translationmessage.ITranslationMessage" |
1879 | 536 | path_expression="string:${potmsgset/sequence}" | 536 | path_expression="string:${potmsgset/sequence}" |
1880 | @@ -544,13 +544,13 @@ | |||
1881 | 544 | <browser:defaultView | 544 | <browser:defaultView |
1882 | 545 | for="lp.translations.interfaces.translationmessage.ITranslationMessage" | 545 | for="lp.translations.interfaces.translationmessage.ITranslationMessage" |
1883 | 546 | name="+index" | 546 | name="+index" |
1885 | 547 | layer="canonical.launchpad.layers.TranslationsLayer"/> | 547 | layer="lp.translations.publisher.TranslationsLayer"/> |
1886 | 548 | <browser:page | 548 | <browser:page |
1887 | 549 | for="lp.translations.interfaces.translationmessage.ITranslationMessage" | 549 | for="lp.translations.interfaces.translationmessage.ITranslationMessage" |
1888 | 550 | class="lp.translations.browser.translationmessage.CurrentTranslationMessageIndexView" | 550 | class="lp.translations.browser.translationmessage.CurrentTranslationMessageIndexView" |
1889 | 551 | permission="zope.Public" | 551 | permission="zope.Public" |
1890 | 552 | name="+index" | 552 | name="+index" |
1892 | 553 | layer="canonical.launchpad.layers.TranslationsLayer"/> | 553 | layer="lp.translations.publisher.TranslationsLayer"/> |
1893 | 554 | <browser:page | 554 | <browser:page |
1894 | 555 | name="+translate" | 555 | name="+translate" |
1895 | 556 | for="lp.translations.interfaces.translationmessage.ITranslationMessage" | 556 | for="lp.translations.interfaces.translationmessage.ITranslationMessage" |
1896 | @@ -562,20 +562,20 @@ | |||
1897 | 562 | permission="zope.Public" | 562 | permission="zope.Public" |
1898 | 563 | template="../templates/translationmessage-translate.pt" | 563 | template="../templates/translationmessage-translate.pt" |
1899 | 564 | class="lp.translations.browser.translationmessage.CurrentTranslationMessagePageView" | 564 | class="lp.translations.browser.translationmessage.CurrentTranslationMessagePageView" |
1901 | 565 | layer="canonical.launchpad.layers.TranslationsLayer"/> | 565 | layer="lp.translations.publisher.TranslationsLayer"/> |
1902 | 566 | <browser:page | 566 | <browser:page |
1903 | 567 | name="+display" | 567 | name="+display" |
1904 | 568 | for="lp.translations.interfaces.translationmessage.ITranslationMessageSuggestions" | 568 | for="lp.translations.interfaces.translationmessage.ITranslationMessageSuggestions" |
1905 | 569 | permission="launchpad.AnyPerson" | 569 | permission="launchpad.AnyPerson" |
1906 | 570 | template="../templates/translationmessage-suggestions.pt" | 570 | template="../templates/translationmessage-suggestions.pt" |
1908 | 571 | layer="canonical.launchpad.layers.TranslationsLayer"/> | 571 | layer="lp.translations.publisher.TranslationsLayer"/> |
1909 | 572 | 572 | ||
1910 | 573 | <!-- SourcePackage translation pages --> | 573 | <!-- SourcePackage translation pages --> |
1911 | 574 | 574 | ||
1912 | 575 | <browser:defaultView | 575 | <browser:defaultView |
1913 | 576 | for="lp.registry.interfaces.sourcepackage.ISourcePackage" | 576 | for="lp.registry.interfaces.sourcepackage.ISourcePackage" |
1914 | 577 | name="+translations" | 577 | name="+translations" |
1916 | 578 | layer="canonical.launchpad.layers.TranslationsLayer"/> | 578 | layer="lp.translations.publisher.TranslationsLayer"/> |
1917 | 579 | <browser:menus | 579 | <browser:menus |
1918 | 580 | classes="SourcePackageTranslationsMenu" | 580 | classes="SourcePackageTranslationsMenu" |
1919 | 581 | module="lp.translations.browser.sourcepackage"/> | 581 | module="lp.translations.browser.sourcepackage"/> |
1920 | @@ -586,11 +586,11 @@ | |||
1921 | 586 | class="lp.translations.browser.hastranslationimports.HasTranslationImportsView" | 586 | class="lp.translations.browser.hastranslationimports.HasTranslationImportsView" |
1922 | 587 | permission="zope.Public" | 587 | permission="zope.Public" |
1923 | 588 | template="../templates/hastranslationimports-index.pt" | 588 | template="../templates/hastranslationimports-index.pt" |
1925 | 589 | layer="canonical.launchpad.layers.TranslationsLayer"/> | 589 | layer="lp.translations.publisher.TranslationsLayer"/> |
1926 | 590 | <browser:page | 590 | <browser:page |
1927 | 591 | for="lp.registry.interfaces.sourcepackage.ISourcePackage" | 591 | for="lp.registry.interfaces.sourcepackage.ISourcePackage" |
1928 | 592 | name="+export" | 592 | name="+export" |
1930 | 593 | layer="canonical.launchpad.layers.TranslationsLayer" | 593 | layer="lp.translations.publisher.TranslationsLayer" |
1931 | 594 | permission="launchpad.ExpensiveRequest" | 594 | permission="launchpad.ExpensiveRequest" |
1932 | 595 | template="../templates/translations-export.pt" | 595 | template="../templates/translations-export.pt" |
1933 | 596 | class=" | 596 | class=" |
1934 | @@ -609,7 +609,7 @@ | |||
1935 | 609 | for="lp.registry.interfaces.sourcepackage.ISourcePackage" | 609 | for="lp.registry.interfaces.sourcepackage.ISourcePackage" |
1936 | 610 | permission="zope.Public" | 610 | permission="zope.Public" |
1937 | 611 | class="lp.translations.browser.sourcepackage.SourcePackageTranslationsView" | 611 | class="lp.translations.browser.sourcepackage.SourcePackageTranslationsView" |
1939 | 612 | layer="canonical.launchpad.layers.TranslationsLayer"> | 612 | layer="lp.translations.publisher.TranslationsLayer"> |
1940 | 613 | <browser:page | 613 | <browser:page |
1941 | 614 | name="+potlist" | 614 | name="+potlist" |
1942 | 615 | template="../templates/object-pots.pt"/> | 615 | template="../templates/object-pots.pt"/> |
1943 | @@ -623,7 +623,7 @@ | |||
1944 | 623 | <browser:defaultView | 623 | <browser:defaultView |
1945 | 624 | for="lp.registry.interfaces.productseries.IProductSeries" | 624 | for="lp.registry.interfaces.productseries.IProductSeries" |
1946 | 625 | name="+translations" | 625 | name="+translations" |
1948 | 626 | layer="canonical.launchpad.layers.TranslationsLayer"/> | 626 | layer="lp.translations.publisher.TranslationsLayer"/> |
1949 | 627 | <browser:menus | 627 | <browser:menus |
1950 | 628 | classes="ProductSeriesTranslationsMenu" | 628 | classes="ProductSeriesTranslationsMenu" |
1951 | 629 | module="lp.translations.browser.productseries"/> | 629 | module="lp.translations.browser.productseries"/> |
1952 | @@ -636,7 +636,7 @@ | |||
1953 | 636 | for="lp.registry.interfaces.productseries.IProductSeries" | 636 | for="lp.registry.interfaces.productseries.IProductSeries" |
1954 | 637 | class="lp.translations.browser.productseries.ProductSeriesView" | 637 | class="lp.translations.browser.productseries.ProductSeriesView" |
1955 | 638 | permission="zope.Public" | 638 | permission="zope.Public" |
1957 | 639 | layer="canonical.launchpad.layers.TranslationsLayer" > | 639 | layer="lp.translations.publisher.TranslationsLayer" > |
1958 | 640 | <browser:page | 640 | <browser:page |
1959 | 641 | name="+translations" | 641 | name="+translations" |
1960 | 642 | template="../templates/productseries-translations.pt" | 642 | template="../templates/productseries-translations.pt" |
1961 | @@ -650,7 +650,7 @@ | |||
1962 | 650 | for="lp.registry.interfaces.productseries.IProductSeries" | 650 | for="lp.registry.interfaces.productseries.IProductSeries" |
1963 | 651 | class="lp.translations.browser.productseries.ProductSeriesUploadView" | 651 | class="lp.translations.browser.productseries.ProductSeriesUploadView" |
1964 | 652 | permission="launchpad.Edit" | 652 | permission="launchpad.Edit" |
1966 | 653 | layer="canonical.launchpad.layers.TranslationsLayer"> | 653 | layer="lp.translations.publisher.TranslationsLayer"> |
1967 | 654 | <browser:page | 654 | <browser:page |
1968 | 655 | name="+translations-upload" | 655 | name="+translations-upload" |
1969 | 656 | template="../templates/productseries-translations-upload.pt"/> | 656 | template="../templates/productseries-translations-upload.pt"/> |
1970 | @@ -661,38 +661,38 @@ | |||
1971 | 661 | class="lp.translations.browser.hastranslationimports.HasTranslationImportsView" | 661 | class="lp.translations.browser.hastranslationimports.HasTranslationImportsView" |
1972 | 662 | permission="zope.Public" | 662 | permission="zope.Public" |
1973 | 663 | template="../templates/hastranslationimports-index.pt" | 663 | template="../templates/hastranslationimports-index.pt" |
1975 | 664 | layer="canonical.launchpad.layers.TranslationsLayer"/> | 664 | layer="lp.translations.publisher.TranslationsLayer"/> |
1976 | 665 | <browser:page | 665 | <browser:page |
1977 | 666 | for="lp.registry.interfaces.productseries.IProductSeries" | 666 | for="lp.registry.interfaces.productseries.IProductSeries" |
1978 | 667 | name="+translations-settings" | 667 | name="+translations-settings" |
1979 | 668 | class="lp.translations.browser.productseries.ProductSeriesTranslationsSettingsView" | 668 | class="lp.translations.browser.productseries.ProductSeriesTranslationsSettingsView" |
1980 | 669 | permission="launchpad.Edit" | 669 | permission="launchpad.Edit" |
1981 | 670 | template="../templates/productseries-translations-settings.pt" | 670 | template="../templates/productseries-translations-settings.pt" |
1983 | 671 | layer="canonical.launchpad.layers.TranslationsLayer"/> | 671 | layer="lp.translations.publisher.TranslationsLayer"/> |
1984 | 672 | <browser:page | 672 | <browser:page |
1985 | 673 | for="lp.registry.interfaces.productseries.IProductSeries" | 673 | for="lp.registry.interfaces.productseries.IProductSeries" |
1986 | 674 | name="+templates" | 674 | name="+templates" |
1987 | 675 | class="lp.translations.browser.productseries.ProductSeriesTemplatesView" | 675 | class="lp.translations.browser.productseries.ProductSeriesTemplatesView" |
1988 | 676 | permission="zope.Public" | 676 | permission="zope.Public" |
1989 | 677 | template="../templates/object-templates.pt" | 677 | template="../templates/object-templates.pt" |
1991 | 678 | layer="canonical.launchpad.layers.TranslationsLayer"/> | 678 | layer="lp.translations.publisher.TranslationsLayer"/> |
1992 | 679 | <browser:page | 679 | <browser:page |
1993 | 680 | for="lp.registry.interfaces.productseries.IProductSeries" | 680 | for="lp.registry.interfaces.productseries.IProductSeries" |
1994 | 681 | name="+request-bzr-import" | 681 | name="+request-bzr-import" |
1995 | 682 | class="lp.translations.browser.productseries.ProductSeriesTranslationsBzrImportView" | 682 | class="lp.translations.browser.productseries.ProductSeriesTranslationsBzrImportView" |
1996 | 683 | permission="launchpad.Edit" | 683 | permission="launchpad.Edit" |
1997 | 684 | template="../templates/productseries-translations-bzr-import.pt" | 684 | template="../templates/productseries-translations-bzr-import.pt" |
1999 | 685 | layer="canonical.launchpad.layers.TranslationsLayer"/> | 685 | layer="lp.translations.publisher.TranslationsLayer"/> |
2000 | 686 | <browser:page | 686 | <browser:page |
2001 | 687 | name="+export" | 687 | name="+export" |
2003 | 688 | layer="canonical.launchpad.layers.TranslationsLayer" | 688 | layer="lp.translations.publisher.TranslationsLayer" |
2004 | 689 | for="lp.registry.interfaces.productseries.IProductSeries" | 689 | for="lp.registry.interfaces.productseries.IProductSeries" |
2005 | 690 | permission="launchpad.AnyPerson" | 690 | permission="launchpad.AnyPerson" |
2006 | 691 | template="../templates/translations-export.pt" | 691 | template="../templates/translations-export.pt" |
2007 | 692 | class="lp.translations.browser.productseries.ProductSeriesTranslationsExportView"/> | 692 | class="lp.translations.browser.productseries.ProductSeriesTranslationsExportView"/> |
2008 | 693 | <browser:page | 693 | <browser:page |
2009 | 694 | name="+link-translations-branch" | 694 | name="+link-translations-branch" |
2011 | 695 | layer="canonical.launchpad.layers.TranslationsLayer" | 695 | layer="lp.translations.publisher.TranslationsLayer" |
2012 | 696 | for="lp.registry.interfaces.productseries.IProductSeries" | 696 | for="lp.registry.interfaces.productseries.IProductSeries" |
2013 | 697 | permission="launchpad.Edit" | 697 | permission="launchpad.Edit" |
2014 | 698 | template="../../app/templates/generic-edit.pt" | 698 | template="../../app/templates/generic-edit.pt" |
2015 | @@ -703,7 +703,7 @@ | |||
2016 | 703 | <browser:defaultView | 703 | <browser:defaultView |
2017 | 704 | for="lp.registry.interfaces.person.IPerson" | 704 | for="lp.registry.interfaces.person.IPerson" |
2018 | 705 | name="+translations" | 705 | name="+translations" |
2020 | 706 | layer="canonical.launchpad.layers.TranslationsLayer"/> | 706 | layer="lp.translations.publisher.TranslationsLayer"/> |
2021 | 707 | <browser:menus | 707 | <browser:menus |
2022 | 708 | module="lp.translations.browser.person" | 708 | module="lp.translations.browser.person" |
2023 | 709 | classes=" | 709 | classes=" |
2024 | @@ -720,7 +720,7 @@ | |||
2025 | 720 | class="lp.translations.browser.person.PersonTranslationView" | 720 | class="lp.translations.browser.person.PersonTranslationView" |
2026 | 721 | permission="zope.Public" | 721 | permission="zope.Public" |
2027 | 722 | template="../templates/person-translations.pt" | 722 | template="../templates/person-translations.pt" |
2029 | 723 | layer="canonical.launchpad.layers.TranslationsLayer"/> | 723 | layer="lp.translations.publisher.TranslationsLayer"/> |
2030 | 724 | <browser:page | 724 | <browser:page |
2031 | 725 | for="lp.registry.interfaces.person.IPerson" | 725 | for="lp.registry.interfaces.person.IPerson" |
2032 | 726 | name="+licensing" | 726 | name="+licensing" |
2033 | @@ -728,14 +728,14 @@ | |||
2034 | 728 | lp.translations.browser.person.PersonTranslationRelicensingView" | 728 | lp.translations.browser.person.PersonTranslationRelicensingView" |
2035 | 729 | permission="launchpad.Edit" | 729 | permission="launchpad.Edit" |
2036 | 730 | template="../templates/person-translations-relicensing.pt" | 730 | template="../templates/person-translations-relicensing.pt" |
2038 | 731 | layer="canonical.launchpad.layers.TranslationsLayer"/> | 731 | layer="lp.translations.publisher.TranslationsLayer"/> |
2039 | 732 | <browser:page | 732 | <browser:page |
2040 | 733 | for="lp.registry.interfaces.person.IPerson" | 733 | for="lp.registry.interfaces.person.IPerson" |
2041 | 734 | name="+imports" | 734 | name="+imports" |
2042 | 735 | class="lp.translations.browser.hastranslationimports.HasTranslationImportsView" | 735 | class="lp.translations.browser.hastranslationimports.HasTranslationImportsView" |
2043 | 736 | permission="zope.Public" | 736 | permission="zope.Public" |
2044 | 737 | template="../templates/hastranslationimports-index.pt" | 737 | template="../templates/hastranslationimports-index.pt" |
2046 | 738 | layer="canonical.launchpad.layers.TranslationsLayer"/> | 738 | layer="lp.translations.publisher.TranslationsLayer"/> |
2047 | 739 | <browser:page | 739 | <browser:page |
2048 | 740 | for="lp.registry.interfaces.person.IPerson" | 740 | for="lp.registry.interfaces.person.IPerson" |
2049 | 741 | class="lp.translations.browser.person.PersonTranslationView" | 741 | class="lp.translations.browser.person.PersonTranslationView" |
2050 | @@ -748,35 +748,35 @@ | |||
2051 | 748 | class="lp.translations.browser.person.TranslationActivityView" | 748 | class="lp.translations.browser.person.TranslationActivityView" |
2052 | 749 | permission="zope.Public" | 749 | permission="zope.Public" |
2053 | 750 | template="../templates/person-translation-activity.pt" | 750 | template="../templates/person-translation-activity.pt" |
2055 | 751 | layer="canonical.launchpad.layers.TranslationsLayer"/> | 751 | layer="lp.translations.publisher.TranslationsLayer"/> |
2056 | 752 | <browser:page | 752 | <browser:page |
2057 | 753 | for="lp.registry.interfaces.person.IPerson" | 753 | for="lp.registry.interfaces.person.IPerson" |
2058 | 754 | name="+translations-to-review" | 754 | name="+translations-to-review" |
2059 | 755 | class="lp.translations.browser.person.PersonTranslationReviewView" | 755 | class="lp.translations.browser.person.PersonTranslationReviewView" |
2060 | 756 | permission="zope.Public" | 756 | permission="zope.Public" |
2061 | 757 | template="../templates/person-translations-to-review.pt" | 757 | template="../templates/person-translations-to-review.pt" |
2063 | 758 | layer="canonical.launchpad.layers.TranslationsLayer"/> | 758 | layer="lp.translations.publisher.TranslationsLayer"/> |
2064 | 759 | <browser:page | 759 | <browser:page |
2065 | 760 | for="lp.registry.interfaces.person.IPerson" | 760 | for="lp.registry.interfaces.person.IPerson" |
2066 | 761 | name="+translations-to-review-table" | 761 | name="+translations-to-review-table" |
2067 | 762 | class="lp.translations.browser.person.PersonTranslationView" | 762 | class="lp.translations.browser.person.PersonTranslationView" |
2068 | 763 | permission="zope.Public" | 763 | permission="zope.Public" |
2069 | 764 | template="../templates/person-translations-to-review-table.pt" | 764 | template="../templates/person-translations-to-review-table.pt" |
2071 | 765 | layer="canonical.launchpad.layers.TranslationsLayer"/> | 765 | layer="lp.translations.publisher.TranslationsLayer"/> |
2072 | 766 | <browser:page | 766 | <browser:page |
2073 | 767 | for="lp.registry.interfaces.person.IPerson" | 767 | for="lp.registry.interfaces.person.IPerson" |
2074 | 768 | name="+translations-to-complete-table" | 768 | name="+translations-to-complete-table" |
2075 | 769 | class="lp.translations.browser.person.PersonTranslationView" | 769 | class="lp.translations.browser.person.PersonTranslationView" |
2076 | 770 | permission="zope.Public" | 770 | permission="zope.Public" |
2077 | 771 | template="../templates/person-translations-to-complete-table.pt" | 771 | template="../templates/person-translations-to-complete-table.pt" |
2079 | 772 | layer="canonical.launchpad.layers.TranslationsLayer"/> | 772 | layer="lp.translations.publisher.TranslationsLayer"/> |
2080 | 773 | 773 | ||
2081 | 774 | 774 | ||
2082 | 775 | <!-- Product views --> | 775 | <!-- Product views --> |
2083 | 776 | 776 | ||
2084 | 777 | <browser:defaultView | 777 | <browser:defaultView |
2085 | 778 | for="lp.registry.interfaces.product.IProduct" | 778 | for="lp.registry.interfaces.product.IProduct" |
2087 | 779 | layer="canonical.launchpad.layers.TranslationsLayer" | 779 | layer="lp.translations.publisher.TranslationsLayer" |
2088 | 780 | name="+translations"/> | 780 | name="+translations"/> |
2089 | 781 | <browser:menus | 781 | <browser:menus |
2090 | 782 | classes=" | 782 | classes=" |
2091 | @@ -798,19 +798,19 @@ | |||
2092 | 798 | class="lp.translations.browser.hastranslationimports.HasTranslationImportsView" | 798 | class="lp.translations.browser.hastranslationimports.HasTranslationImportsView" |
2093 | 799 | permission="zope.Public" | 799 | permission="zope.Public" |
2094 | 800 | template="../templates/hastranslationimports-index.pt" | 800 | template="../templates/hastranslationimports-index.pt" |
2096 | 801 | layer="canonical.launchpad.layers.TranslationsLayer"/> | 801 | layer="lp.translations.publisher.TranslationsLayer"/> |
2097 | 802 | <browser:page | 802 | <browser:page |
2098 | 803 | name="+settings" | 803 | name="+settings" |
2099 | 804 | for="lp.registry.interfaces.product.IProduct" | 804 | for="lp.registry.interfaces.product.IProduct" |
2100 | 805 | class="lp.translations.browser.product.ProductSettingsView" | 805 | class="lp.translations.browser.product.ProductSettingsView" |
2101 | 806 | permission="launchpad.TranslationsAdmin" | 806 | permission="launchpad.TranslationsAdmin" |
2102 | 807 | template="../templates/set-translators.pt" | 807 | template="../templates/set-translators.pt" |
2104 | 808 | layer="canonical.launchpad.layers.TranslationsLayer"/> | 808 | layer="lp.translations.publisher.TranslationsLayer"/> |
2105 | 809 | <browser:pages | 809 | <browser:pages |
2106 | 810 | for="lp.registry.interfaces.product.IProduct" | 810 | for="lp.registry.interfaces.product.IProduct" |
2107 | 811 | permission="zope.Public" | 811 | permission="zope.Public" |
2108 | 812 | class="lp.translations.browser.product.ProductView" | 812 | class="lp.translations.browser.product.ProductView" |
2110 | 813 | layer="canonical.launchpad.layers.TranslationsLayer"> | 813 | layer="lp.translations.publisher.TranslationsLayer"> |
2111 | 814 | <browser:page | 814 | <browser:page |
2112 | 815 | name="+translations" | 815 | name="+translations" |
2113 | 816 | template="../templates/product-translations.pt"/> | 816 | template="../templates/product-translations.pt"/> |
2114 | @@ -830,7 +830,7 @@ | |||
2115 | 830 | <browser:defaultView | 830 | <browser:defaultView |
2116 | 831 | for="lp.registry.interfaces.projectgroup.IProjectGroup" | 831 | for="lp.registry.interfaces.projectgroup.IProjectGroup" |
2117 | 832 | name="+translations" | 832 | name="+translations" |
2119 | 833 | layer="canonical.launchpad.layers.TranslationsLayer"/> | 833 | layer="lp.translations.publisher.TranslationsLayer"/> |
2120 | 834 | <browser:menus | 834 | <browser:menus |
2121 | 835 | classes=" | 835 | classes=" |
2122 | 836 | ProjectTranslationsMenu" | 836 | ProjectTranslationsMenu" |
2123 | @@ -846,7 +846,7 @@ | |||
2124 | 846 | name="+translations" | 846 | name="+translations" |
2125 | 847 | class="lp.translations.browser.project.ProjectView" | 847 | class="lp.translations.browser.project.ProjectView" |
2126 | 848 | template="../templates/project-translations.pt" | 848 | template="../templates/project-translations.pt" |
2128 | 849 | layer="canonical.launchpad.layers.TranslationsLayer"/> | 849 | layer="lp.translations.publisher.TranslationsLayer"/> |
2129 | 850 | <browser:page | 850 | <browser:page |
2130 | 851 | name="+help-translate-button" | 851 | name="+help-translate-button" |
2131 | 852 | for="lp.registry.interfaces.projectgroup.IProjectGroup" | 852 | for="lp.registry.interfaces.projectgroup.IProjectGroup" |
2132 | @@ -858,14 +858,14 @@ | |||
2133 | 858 | class="lp.translations.browser.project.ProjectSettingsView" | 858 | class="lp.translations.browser.project.ProjectSettingsView" |
2134 | 859 | permission="launchpad.TranslationsAdmin" | 859 | permission="launchpad.TranslationsAdmin" |
2135 | 860 | template="../templates/set-translators.pt" | 860 | template="../templates/set-translators.pt" |
2137 | 861 | layer="canonical.launchpad.layers.TranslationsLayer"/> | 861 | layer="lp.translations.publisher.TranslationsLayer"/> |
2138 | 862 | 862 | ||
2139 | 863 | <!-- Distribution --> | 863 | <!-- Distribution --> |
2140 | 864 | 864 | ||
2141 | 865 | <browser:defaultView | 865 | <browser:defaultView |
2142 | 866 | for="lp.registry.interfaces.distribution.IDistribution" | 866 | for="lp.registry.interfaces.distribution.IDistribution" |
2143 | 867 | name="+translations" | 867 | name="+translations" |
2145 | 868 | layer="canonical.launchpad.layers.TranslationsLayer"/> | 868 | layer="lp.translations.publisher.TranslationsLayer"/> |
2146 | 869 | <browser:menus | 869 | <browser:menus |
2147 | 870 | classes=" | 870 | classes=" |
2148 | 871 | DistributionTranslationsMenu" | 871 | DistributionTranslationsMenu" |
2149 | @@ -881,7 +881,7 @@ | |||
2150 | 881 | permission="zope.Public" | 881 | permission="zope.Public" |
2151 | 882 | name="+translations" | 882 | name="+translations" |
2152 | 883 | template="../templates/distribution-translations.pt" | 883 | template="../templates/distribution-translations.pt" |
2154 | 884 | layer="canonical.launchpad.layers.TranslationsLayer"/> | 884 | layer="lp.translations.publisher.TranslationsLayer"/> |
2155 | 885 | <browser:page | 885 | <browser:page |
2156 | 886 | name="+help-translate-button" | 886 | name="+help-translate-button" |
2157 | 887 | for="lp.registry.interfaces.distribution.IDistribution" | 887 | for="lp.registry.interfaces.distribution.IDistribution" |
2158 | @@ -893,35 +893,35 @@ | |||
2159 | 893 | class="lp.translations.browser.distribution.DistributionSettingsView" | 893 | class="lp.translations.browser.distribution.DistributionSettingsView" |
2160 | 894 | permission="launchpad.TranslationsAdmin" | 894 | permission="launchpad.TranslationsAdmin" |
2161 | 895 | template="../templates/set-translators.pt" | 895 | template="../templates/set-translators.pt" |
2163 | 896 | layer="canonical.launchpad.layers.TranslationsLayer"/> | 896 | layer="lp.translations.publisher.TranslationsLayer"/> |
2164 | 897 | <browser:page | 897 | <browser:page |
2165 | 898 | for="lp.registry.interfaces.distribution.IDistribution" | 898 | for="lp.registry.interfaces.distribution.IDistribution" |
2166 | 899 | name="+imports" | 899 | name="+imports" |
2167 | 900 | class="lp.translations.browser.hastranslationimports.HasTranslationImportsView" | 900 | class="lp.translations.browser.hastranslationimports.HasTranslationImportsView" |
2168 | 901 | permission="zope.Public" | 901 | permission="zope.Public" |
2169 | 902 | template="../templates/hastranslationimports-index.pt" | 902 | template="../templates/hastranslationimports-index.pt" |
2171 | 903 | layer="canonical.launchpad.layers.TranslationsLayer"/> | 903 | layer="lp.translations.publisher.TranslationsLayer"/> |
2172 | 904 | <browser:page | 904 | <browser:page |
2173 | 905 | for="lp.registry.interfaces.distribution.IDistribution" | 905 | for="lp.registry.interfaces.distribution.IDistribution" |
2174 | 906 | name="+select-language-pack-admin" | 906 | name="+select-language-pack-admin" |
2175 | 907 | class="lp.translations.browser.distribution.DistributionLanguagePackAdminView" | 907 | class="lp.translations.browser.distribution.DistributionLanguagePackAdminView" |
2176 | 908 | permission="launchpad.TranslationsAdmin" | 908 | permission="launchpad.TranslationsAdmin" |
2177 | 909 | template="../../app/templates/generic-edit.pt" | 909 | template="../../app/templates/generic-edit.pt" |
2179 | 910 | layer="canonical.launchpad.layers.TranslationsLayer"/> | 910 | layer="lp.translations.publisher.TranslationsLayer"/> |
2180 | 911 | <!-- Language pack admin portlet --> | 911 | <!-- Language pack admin portlet --> |
2181 | 912 | <browser:page | 912 | <browser:page |
2182 | 913 | name="+language-pack-admin-info" | 913 | name="+language-pack-admin-info" |
2183 | 914 | for="lp.registry.interfaces.distribution.IDistribution" | 914 | for="lp.registry.interfaces.distribution.IDistribution" |
2184 | 915 | permission="launchpad.View" | 915 | permission="launchpad.View" |
2185 | 916 | template="../templates/distribution-language-pack-admin-info.pt" | 916 | template="../templates/distribution-language-pack-admin-info.pt" |
2187 | 917 | layer="canonical.launchpad.layers.TranslationsLayer"/> | 917 | layer="lp.translations.publisher.TranslationsLayer"/> |
2188 | 918 | 918 | ||
2189 | 919 | <!-- DistroSeries --> | 919 | <!-- DistroSeries --> |
2190 | 920 | 920 | ||
2191 | 921 | <browser:defaultView | 921 | <browser:defaultView |
2192 | 922 | for="lp.registry.interfaces.distroseries.IDistroSeries" | 922 | for="lp.registry.interfaces.distroseries.IDistroSeries" |
2193 | 923 | name="+translations" | 923 | name="+translations" |
2195 | 924 | layer="canonical.launchpad.layers.TranslationsLayer"/> | 924 | layer="lp.translations.publisher.TranslationsLayer"/> |
2196 | 925 | <browser:menus | 925 | <browser:menus |
2197 | 926 | classes=" | 926 | classes=" |
2198 | 927 | DistroSeriesTranslationsMenu" | 927 | DistroSeriesTranslationsMenu" |
2199 | @@ -936,7 +936,7 @@ | |||
2200 | 936 | for="lp.registry.interfaces.distroseries.IDistroSeries" | 936 | for="lp.registry.interfaces.distroseries.IDistroSeries" |
2201 | 937 | class="lp.translations.browser.distroseries.DistroSeriesView" | 937 | class="lp.translations.browser.distroseries.DistroSeriesView" |
2202 | 938 | permission="zope.Public" | 938 | permission="zope.Public" |
2204 | 939 | layer="canonical.launchpad.layers.TranslationsLayer"> | 939 | layer="lp.translations.publisher.TranslationsLayer"> |
2205 | 940 | <browser:page | 940 | <browser:page |
2206 | 941 | name="+translations" | 941 | name="+translations" |
2207 | 942 | template="../templates/distroseries-translations.pt"/> | 942 | template="../templates/distroseries-translations.pt"/> |
2208 | @@ -948,7 +948,7 @@ | |||
2209 | 948 | for="lp.registry.interfaces.distroseries.IDistroSeries" | 948 | for="lp.registry.interfaces.distroseries.IDistroSeries" |
2210 | 949 | class="lp.translations.browser.distroseries.DistroSeriesTemplatesView" | 949 | class="lp.translations.browser.distroseries.DistroSeriesTemplatesView" |
2211 | 950 | permission="zope.Public" | 950 | permission="zope.Public" |
2213 | 951 | layer="canonical.launchpad.layers.TranslationsLayer" | 951 | layer="lp.translations.publisher.TranslationsLayer" |
2214 | 952 | name="+templates" | 952 | name="+templates" |
2215 | 953 | template="../templates/object-templates.pt" /> | 953 | template="../templates/object-templates.pt" /> |
2216 | 954 | <browser:page | 954 | <browser:page |
2217 | @@ -962,19 +962,19 @@ | |||
2218 | 962 | class="lp.translations.browser.distroseries.DistroSeriesTranslationsAdminView" | 962 | class="lp.translations.browser.distroseries.DistroSeriesTranslationsAdminView" |
2219 | 963 | name="+admin" | 963 | name="+admin" |
2220 | 964 | template="../../app/templates/generic-edit.pt" | 964 | template="../../app/templates/generic-edit.pt" |
2222 | 965 | layer="canonical.launchpad.layers.TranslationsLayer"/> | 965 | layer="lp.translations.publisher.TranslationsLayer"/> |
2223 | 966 | <browser:page | 966 | <browser:page |
2224 | 967 | for="lp.registry.interfaces.distroseries.IDistroSeries" | 967 | for="lp.registry.interfaces.distroseries.IDistroSeries" |
2225 | 968 | name="+imports" | 968 | name="+imports" |
2226 | 969 | class="lp.translations.browser.hastranslationimports.HasTranslationImportsView" | 969 | class="lp.translations.browser.hastranslationimports.HasTranslationImportsView" |
2227 | 970 | permission="zope.Public" | 970 | permission="zope.Public" |
2228 | 971 | template="../templates/hastranslationimports-index.pt" | 971 | template="../templates/hastranslationimports-index.pt" |
2230 | 972 | layer="canonical.launchpad.layers.TranslationsLayer"/> | 972 | layer="lp.translations.publisher.TranslationsLayer"/> |
2231 | 973 | <browser:page | 973 | <browser:page |
2232 | 974 | for="lp.registry.interfaces.distroseries.IDistroSeries" | 974 | for="lp.registry.interfaces.distroseries.IDistroSeries" |
2233 | 975 | class="lp.translations.browser.distroseries.DistroSeriesLanguagePackView" | 975 | class="lp.translations.browser.distroseries.DistroSeriesLanguagePackView" |
2234 | 976 | permission="zope.Public" | 976 | permission="zope.Public" |
2236 | 977 | layer="canonical.launchpad.layers.TranslationsLayer" | 977 | layer="lp.translations.publisher.TranslationsLayer" |
2237 | 978 | name="+language-packs" | 978 | name="+language-packs" |
2238 | 979 | template="../templates/distroseries-language-packs.pt"/> | 979 | template="../templates/distroseries-language-packs.pt"/> |
2239 | 980 | 980 | ||
2240 | @@ -984,7 +984,7 @@ | |||
2241 | 984 | <browser:defaultView | 984 | <browser:defaultView |
2242 | 985 | for="lp.translations.interfaces.customlanguagecode.ICustomLanguageCode" | 985 | for="lp.translations.interfaces.customlanguagecode.ICustomLanguageCode" |
2243 | 986 | name="+index" | 986 | name="+index" |
2245 | 987 | layer="canonical.launchpad.layers.TranslationsLayer"/> | 987 | layer="lp.translations.publisher.TranslationsLayer"/> |
2246 | 988 | <browser:url | 988 | <browser:url |
2247 | 989 | for="lp.translations.interfaces.customlanguagecode.ICustomLanguageCode" | 989 | for="lp.translations.interfaces.customlanguagecode.ICustomLanguageCode" |
2248 | 990 | path_expression="string:+customcode/${language_code}" | 990 | path_expression="string:+customcode/${language_code}" |
2249 | @@ -996,7 +996,7 @@ | |||
2250 | 996 | permission="zope.Public" | 996 | permission="zope.Public" |
2251 | 997 | class="lp.translations.browser.customlanguagecode.CustomLanguageCodeView" | 997 | class="lp.translations.browser.customlanguagecode.CustomLanguageCodeView" |
2252 | 998 | template="../templates/customlanguagecode-index.pt" | 998 | template="../templates/customlanguagecode-index.pt" |
2254 | 999 | layer="canonical.launchpad.layers.TranslationsLayer"/> | 999 | layer="lp.translations.publisher.TranslationsLayer"/> |
2255 | 1000 | 1000 | ||
2256 | 1001 | <browser:page | 1001 | <browser:page |
2257 | 1002 | name="+remove" | 1002 | name="+remove" |
2258 | @@ -1004,21 +1004,21 @@ | |||
2259 | 1004 | permission="launchpad.Admin" | 1004 | permission="launchpad.Admin" |
2260 | 1005 | class="lp.translations.browser.customlanguagecode.CustomLanguageCodeRemoveView" | 1005 | class="lp.translations.browser.customlanguagecode.CustomLanguageCodeRemoveView" |
2261 | 1006 | template="../../app/templates/generic-edit.pt" | 1006 | template="../../app/templates/generic-edit.pt" |
2263 | 1007 | layer="canonical.launchpad.layers.TranslationsLayer"/> | 1007 | layer="lp.translations.publisher.TranslationsLayer"/> |
2264 | 1008 | 1008 | ||
2265 | 1009 | <!-- IHasCustomLanguageCodes --> | 1009 | <!-- IHasCustomLanguageCodes --> |
2266 | 1010 | 1010 | ||
2267 | 1011 | <browser:page | 1011 | <browser:page |
2268 | 1012 | name="+custom-language-codes" | 1012 | name="+custom-language-codes" |
2269 | 1013 | for="lp.translations.interfaces.customlanguagecode.IHasCustomLanguageCodes" | 1013 | for="lp.translations.interfaces.customlanguagecode.IHasCustomLanguageCodes" |
2271 | 1014 | layer="canonical.launchpad.layers.TranslationsLayer" | 1014 | layer="lp.translations.publisher.TranslationsLayer" |
2272 | 1015 | class="lp.translations.browser.customlanguagecode.CustomLanguageCodesIndexView" | 1015 | class="lp.translations.browser.customlanguagecode.CustomLanguageCodesIndexView" |
2273 | 1016 | template="../templates/customlanguagecodes-index.pt" | 1016 | template="../templates/customlanguagecodes-index.pt" |
2274 | 1017 | permission="zope.Public"/> | 1017 | permission="zope.Public"/> |
2275 | 1018 | <browser:page | 1018 | <browser:page |
2276 | 1019 | name="+add-custom-language-code" | 1019 | name="+add-custom-language-code" |
2277 | 1020 | for="lp.translations.interfaces.customlanguagecode.IHasCustomLanguageCodes" | 1020 | for="lp.translations.interfaces.customlanguagecode.IHasCustomLanguageCodes" |
2279 | 1021 | layer="canonical.launchpad.layers.TranslationsLayer" | 1021 | layer="lp.translations.publisher.TranslationsLayer" |
2280 | 1022 | class="lp.translations.browser.customlanguagecode.CustomLanguageCodeAddView" | 1022 | class="lp.translations.browser.customlanguagecode.CustomLanguageCodeAddView" |
2281 | 1023 | template="../templates/customlanguagecode-add.pt" | 1023 | template="../templates/customlanguagecode-add.pt" |
2282 | 1024 | permission="launchpad.Admin"/> | 1024 | permission="launchpad.Admin"/> |
2283 | 1025 | 1025 | ||
2284 | === modified file 'lib/lp/translations/browser/tests/language-views.txt' | |||
2285 | --- lib/lp/translations/browser/tests/language-views.txt 2010-04-21 13:08:48 +0000 | |||
2286 | +++ lib/lp/translations/browser/tests/language-views.txt 2010-07-22 20:59:01 +0000 | |||
2287 | @@ -6,7 +6,7 @@ | |||
2288 | 6 | 6 | ||
2289 | 7 | >>> from zope.component import getUtility | 7 | >>> from zope.component import getUtility |
2290 | 8 | >>> from lp.services.worlddata.interfaces.language import ILanguageSet | 8 | >>> from lp.services.worlddata.interfaces.language import ILanguageSet |
2292 | 9 | >>> from canonical.launchpad.layers import TranslationsLayer | 9 | >>> from lp.translations.publisher import TranslationsLayer |
2293 | 10 | 10 | ||
2294 | 11 | >>> language_set = getUtility(ILanguageSet) | 11 | >>> language_set = getUtility(ILanguageSet) |
2295 | 12 | >>> portuguese = language_set.getLanguageByCode('pt_BR') | 12 | >>> portuguese = language_set.getLanguageByCode('pt_BR') |
2296 | 13 | 13 | ||
2297 | === modified file 'lib/lp/translations/browser/tests/poexport-request-views.txt' | |||
2298 | --- lib/lp/translations/browser/tests/poexport-request-views.txt 2009-07-02 17:16:50 +0000 | |||
2299 | +++ lib/lp/translations/browser/tests/poexport-request-views.txt 2010-07-22 20:59:01 +0000 | |||
2300 | @@ -1,7 +1,7 @@ | |||
2301 | 1 | PO Export Request Browser Views | 1 | PO Export Request Browser Views |
2302 | 2 | ------------------------------- | 2 | ------------------------------- |
2303 | 3 | 3 | ||
2305 | 4 | >>> from canonical.launchpad.layers import TranslationsLayer | 4 | >>> from lp.translations.publisher import TranslationsLayer |
2306 | 5 | 5 | ||
2307 | 6 | Check there are no requests in the database to start with. | 6 | Check there are no requests in the database to start with. |
2308 | 7 | 7 | ||
2309 | 8 | 8 | ||
2310 | === modified file 'lib/lp/translations/browser/tests/pofile-views.txt' | |||
2311 | --- lib/lp/translations/browser/tests/pofile-views.txt 2010-01-20 22:41:54 +0000 | |||
2312 | +++ lib/lp/translations/browser/tests/pofile-views.txt 2010-07-22 20:59:01 +0000 | |||
2313 | @@ -15,7 +15,7 @@ | |||
2314 | 15 | >>> from lp.registry.interfaces.distribution import IDistributionSet | 15 | >>> from lp.registry.interfaces.distribution import IDistributionSet |
2315 | 16 | >>> from lp.registry.interfaces.sourcepackagename import ( | 16 | >>> from lp.registry.interfaces.sourcepackagename import ( |
2316 | 17 | ... ISourcePackageNameSet) | 17 | ... ISourcePackageNameSet) |
2318 | 18 | >>> from canonical.launchpad.layers import TranslationsLayer | 18 | >>> from lp.translations.publisher import TranslationsLayer |
2319 | 19 | 19 | ||
2320 | 20 | All the tests will be submitted as coming from the No Privilege person. | 20 | All the tests will be submitted as coming from the No Privilege person. |
2321 | 21 | 21 | ||
2322 | 22 | 22 | ||
2323 | === modified file 'lib/lp/translations/browser/tests/potemplate-views.txt' | |||
2324 | --- lib/lp/translations/browser/tests/potemplate-views.txt 2009-07-02 17:16:50 +0000 | |||
2325 | +++ lib/lp/translations/browser/tests/potemplate-views.txt 2010-07-22 20:59:01 +0000 | |||
2326 | @@ -13,7 +13,7 @@ | |||
2327 | 13 | >>> from lp.registry.interfaces.distribution import IDistributionSet | 13 | >>> from lp.registry.interfaces.distribution import IDistributionSet |
2328 | 14 | >>> from lp.registry.interfaces.sourcepackagename import ( | 14 | >>> from lp.registry.interfaces.sourcepackagename import ( |
2329 | 15 | ... ISourcePackageNameSet) | 15 | ... ISourcePackageNameSet) |
2331 | 16 | >>> from canonical.launchpad.layers import TranslationsLayer | 16 | >>> from lp.translations.publisher import TranslationsLayer |
2332 | 17 | >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest | 17 | >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest |
2333 | 18 | 18 | ||
2334 | 19 | All the tests will be submitted as comming from the No Privilege person. | 19 | All the tests will be submitted as comming from the No Privilege person. |
2335 | 20 | 20 | ||
2336 | === modified file 'lib/lp/translations/browser/tests/test_translationimportqueueentry.py' | |||
2337 | --- lib/lp/translations/browser/tests/test_translationimportqueueentry.py 2010-04-19 15:24:29 +0000 | |||
2338 | +++ lib/lp/translations/browser/tests/test_translationimportqueueentry.py 2010-07-22 20:59:01 +0000 | |||
2339 | @@ -12,12 +12,13 @@ | |||
2340 | 12 | 12 | ||
2341 | 13 | from canonical.testing import LaunchpadFunctionalLayer | 13 | from canonical.testing import LaunchpadFunctionalLayer |
2342 | 14 | 14 | ||
2344 | 15 | from canonical.launchpad.layers import TranslationsLayer, setFirstLayer | 15 | from canonical.launchpad.layers import setFirstLayer |
2345 | 16 | from canonical.launchpad.webapp import canonical_url | 16 | from canonical.launchpad.webapp import canonical_url |
2346 | 17 | from canonical.launchpad.webapp.servers import LaunchpadTestRequest | 17 | from canonical.launchpad.webapp.servers import LaunchpadTestRequest |
2347 | 18 | from lp.testing import TestCaseWithFactory | 18 | from lp.testing import TestCaseWithFactory |
2348 | 19 | from lp.translations.interfaces.translationimportqueue import ( | 19 | from lp.translations.interfaces.translationimportqueue import ( |
2349 | 20 | ITranslationImportQueue) | 20 | ITranslationImportQueue) |
2350 | 21 | from lp.translations.publisher import TranslationsLayer | ||
2351 | 21 | 22 | ||
2352 | 22 | 23 | ||
2353 | 23 | class TestTranslationImportQueueEntryView(TestCaseWithFactory): | 24 | class TestTranslationImportQueueEntryView(TestCaseWithFactory): |
2354 | 24 | 25 | ||
2355 | === modified file 'lib/lp/translations/browser/tests/translationimportqueue-views.txt' | |||
2356 | --- lib/lp/translations/browser/tests/translationimportqueue-views.txt 2009-07-02 17:16:50 +0000 | |||
2357 | +++ lib/lp/translations/browser/tests/translationimportqueue-views.txt 2010-07-22 20:59:01 +0000 | |||
2358 | @@ -5,11 +5,12 @@ | |||
2359 | 5 | 5 | ||
2360 | 6 | >>> from zope.component import getUtility, getMultiAdapter | 6 | >>> from zope.component import getUtility, getMultiAdapter |
2361 | 7 | >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest | 7 | >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest |
2362 | 8 | >>> from canonical.launchpad.layers import setFirstLayer | ||
2363 | 8 | >>> from lp.translations.interfaces.translationimportqueue import ( | 9 | >>> from lp.translations.interfaces.translationimportqueue import ( |
2364 | 9 | ... ITranslationImportQueue) | 10 | ... ITranslationImportQueue) |
2365 | 10 | >>> from lp.translations.browser.translationimportqueue import ( | 11 | >>> from lp.translations.browser.translationimportqueue import ( |
2366 | 11 | ... TranslationImportQueueEntryView) | 12 | ... TranslationImportQueueEntryView) |
2368 | 12 | >>> from canonical.launchpad.layers import TranslationsLayer, setFirstLayer | 13 | >>> from lp.translations.publisher import TranslationsLayer |
2369 | 13 | 14 | ||
2370 | 14 | This view is only accessible for administrators. | 15 | This view is only accessible for administrators. |
2371 | 15 | 16 | ||
2372 | 16 | 17 | ||
2373 | === modified file 'lib/lp/translations/browser/tests/translationmessage-views.txt' | |||
2374 | --- lib/lp/translations/browser/tests/translationmessage-views.txt 2010-03-22 17:18:28 +0000 | |||
2375 | +++ lib/lp/translations/browser/tests/translationmessage-views.txt 2010-07-22 20:59:01 +0000 | |||
2376 | @@ -7,7 +7,7 @@ | |||
2377 | 7 | >>> from lp.translations.model.pofile import POFile | 7 | >>> from lp.translations.model.pofile import POFile |
2378 | 8 | >>> from lp.translations.model.translationmessage import ( | 8 | >>> from lp.translations.model.translationmessage import ( |
2379 | 9 | ... TranslationMessage) | 9 | ... TranslationMessage) |
2381 | 10 | >>> from canonical.launchpad.layers import TranslationsLayer | 10 | >>> from lp.translations.publisher import TranslationsLayer |
2382 | 11 | >>> from canonical.launchpad.webapp import canonical_url | 11 | >>> from canonical.launchpad.webapp import canonical_url |
2383 | 12 | 12 | ||
2384 | 13 | All the tests will be submitted as comming from Kurem, an editor for the POFile | 13 | All the tests will be submitted as comming from Kurem, an editor for the POFile |
2385 | 14 | 14 | ||
2386 | === modified file 'lib/lp/translations/browser/tests/translator-views.txt' | |||
2387 | --- lib/lp/translations/browser/tests/translator-views.txt 2009-09-17 11:28:13 +0000 | |||
2388 | +++ lib/lp/translations/browser/tests/translator-views.txt 2010-07-22 20:59:01 +0000 | |||
2389 | @@ -23,7 +23,7 @@ | |||
2390 | 23 | 23 | ||
2391 | 24 | Translator +admin view provides a nice page title and a form label. | 24 | Translator +admin view provides a nice page title and a form label. |
2392 | 25 | 25 | ||
2394 | 26 | >>> from canonical.launchpad.layers import TranslationsLayer | 26 | >>> from lp.translations.publisher import TranslationsLayer |
2395 | 27 | >>> view = create_initialized_view(translator, '+admin', | 27 | >>> view = create_initialized_view(translator, '+admin', |
2396 | 28 | ... layer=TranslationsLayer) | 28 | ... layer=TranslationsLayer) |
2397 | 29 | >>> print view.label | 29 | >>> print view.label |
2398 | @@ -45,7 +45,7 @@ | |||
2399 | 45 | for a language in a TranslationGroup, and page title and form label | 45 | for a language in a TranslationGroup, and page title and form label |
2400 | 46 | describe that appropriately. | 46 | describe that appropriately. |
2401 | 47 | 47 | ||
2403 | 48 | >>> from canonical.launchpad.layers import TranslationsLayer | 48 | >>> from lp.translations.publisher import TranslationsLayer |
2404 | 49 | >>> view = create_initialized_view(translator, '+edit', | 49 | >>> view = create_initialized_view(translator, '+edit', |
2405 | 50 | ... layer=TranslationsLayer) | 50 | ... layer=TranslationsLayer) |
2406 | 51 | >>> print view.label | 51 | >>> print view.label |
2407 | @@ -66,7 +66,7 @@ | |||
2408 | 66 | Translator +edit view allows one to only set translation guidelines | 66 | Translator +edit view allows one to only set translation guidelines |
2409 | 67 | for a language in a TranslationGroup. | 67 | for a language in a TranslationGroup. |
2410 | 68 | 68 | ||
2412 | 69 | >>> from canonical.launchpad.layers import TranslationsLayer | 69 | >>> from lp.translations.publisher import TranslationsLayer |
2413 | 70 | >>> view = create_initialized_view(translator, '+remove', | 70 | >>> view = create_initialized_view(translator, '+remove', |
2414 | 71 | ... layer=TranslationsLayer) | 71 | ... layer=TranslationsLayer) |
2415 | 72 | >>> print view.label | 72 | >>> print view.label |
2416 | 73 | 73 | ||
2417 | === modified file 'lib/lp/translations/browser/translations.py' | |||
2418 | --- lib/lp/translations/browser/translations.py 2010-02-01 21:20:57 +0000 | |||
2419 | +++ lib/lp/translations/browser/translations.py 2010-07-22 20:59:01 +0000 | |||
2420 | @@ -27,7 +27,7 @@ | |||
2421 | 27 | from lp.registry.interfaces.product import IProductSet | 27 | from lp.registry.interfaces.product import IProductSet |
2422 | 28 | from lp.services.worlddata.interfaces.country import ICountry | 28 | from lp.services.worlddata.interfaces.country import ICountry |
2423 | 29 | from lp.registry.interfaces.person import IPersonSet | 29 | from lp.registry.interfaces.person import IPersonSet |
2425 | 30 | from canonical.launchpad.layers import TranslationsLayer | 30 | from lp.translations.publisher import TranslationsLayer |
2426 | 31 | from canonical.launchpad.webapp import ( | 31 | from canonical.launchpad.webapp import ( |
2427 | 32 | LaunchpadView, Navigation, stepto, canonical_url) | 32 | LaunchpadView, Navigation, stepto, canonical_url) |
2428 | 33 | from canonical.launchpad.webapp.batching import BatchNavigator | 33 | from canonical.launchpad.webapp.batching import BatchNavigator |
2429 | @@ -183,7 +183,7 @@ | |||
2430 | 183 | self.request.response.redirect( | 183 | self.request.response.redirect( |
2431 | 184 | '/'.join([ | 184 | '/'.join([ |
2432 | 185 | canonical_url(self.context, rootsite='translations'), | 185 | canonical_url(self.context, rootsite='translations'), |
2434 | 186 | self.page | 186 | self.page, |
2435 | 187 | ]), status=301) | 187 | ]), status=301) |
2436 | 188 | 188 | ||
2437 | 189 | 189 | ||
2438 | @@ -208,6 +208,7 @@ | |||
2439 | 208 | 208 | ||
2440 | 209 | class TranslationsLanguageBreadcrumb(Breadcrumb): | 209 | class TranslationsLanguageBreadcrumb(Breadcrumb): |
2441 | 210 | """Breadcrumb for objects with language.""" | 210 | """Breadcrumb for objects with language.""" |
2442 | 211 | |||
2443 | 211 | @property | 212 | @property |
2444 | 212 | def text(self): | 213 | def text(self): |
2445 | 213 | return self.context.language.displayname | 214 | return self.context.language.displayname |
2446 | 214 | 215 | ||
2447 | === modified file 'lib/lp/translations/configure.zcml' | |||
2448 | --- lib/lp/translations/configure.zcml 2010-07-19 13:30:29 +0000 | |||
2449 | +++ lib/lp/translations/configure.zcml 2010-07-22 20:59:01 +0000 | |||
2450 | @@ -13,8 +13,12 @@ | |||
2451 | 13 | <include | 13 | <include |
2452 | 14 | package=".browser"/> | 14 | package=".browser"/> |
2453 | 15 | 15 | ||
2454 | 16 | <publisher | ||
2455 | 17 | name="translations" | ||
2456 | 18 | factory="lp.translations.publisher.translations_request_publication_factory"/> | ||
2457 | 19 | |||
2458 | 16 | <lp:help-folder | 20 | <lp:help-folder |
2460 | 17 | folder="help" type="canonical.launchpad.layers.TranslationsLayer" /> | 21 | folder="help" type="lp.translations.publisher.TranslationsLayer" /> |
2461 | 18 | 22 | ||
2462 | 19 | <class | 23 | <class |
2463 | 20 | class="lp.translations.model.vpotexport.VPOTExport"> | 24 | class="lp.translations.model.vpotexport.VPOTExport"> |
2464 | 21 | 25 | ||
2465 | === modified file 'lib/lp/translations/doc/rosetta-karma.txt' | |||
2466 | --- lib/lp/translations/doc/rosetta-karma.txt 2010-02-16 20:36:48 +0000 | |||
2467 | +++ lib/lp/translations/doc/rosetta-karma.txt 2010-07-22 20:59:01 +0000 | |||
2468 | @@ -364,7 +364,7 @@ | |||
2469 | 364 | product from where the IPOTemplate is and he has rights to change the | 364 | product from where the IPOTemplate is and he has rights to change the |
2470 | 365 | description. | 365 | description. |
2471 | 366 | 366 | ||
2473 | 367 | >>> from canonical.launchpad.layers import TranslationsLayer | 367 | >>> from lp.translations.publisher import TranslationsLayer |
2474 | 368 | >>> sample_person = personset.getByEmail('test@canonical.com') | 368 | >>> sample_person = personset.getByEmail('test@canonical.com') |
2475 | 369 | >>> login('test@canonical.com') | 369 | >>> login('test@canonical.com') |
2476 | 370 | >>> form = { | 370 | >>> form = { |
2477 | 371 | 371 | ||
2478 | === added file 'lib/lp/translations/publisher.py' | |||
2479 | --- lib/lp/translations/publisher.py 1970-01-01 00:00:00 +0000 | |||
2480 | +++ lib/lp/translations/publisher.py 2010-07-22 20:59:01 +0000 | |||
2481 | @@ -0,0 +1,42 @@ | |||
2482 | 1 | # Copyright 2010 Canonical Ltd. This software is licensed under the | ||
2483 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | ||
2484 | 3 | |||
2485 | 4 | """Translations's custom publication.""" | ||
2486 | 5 | |||
2487 | 6 | __metaclass__ = type | ||
2488 | 7 | __all__ = [ | ||
2489 | 8 | 'TranslationsBrowserRequest', | ||
2490 | 9 | 'TranslationsLayer', | ||
2491 | 10 | 'translations_request_publication_factory', | ||
2492 | 11 | ] | ||
2493 | 12 | |||
2494 | 13 | |||
2495 | 14 | from zope.interface import implements | ||
2496 | 15 | from zope.publisher.interfaces.browser import ( | ||
2497 | 16 | IBrowserRequest, IDefaultBrowserLayer) | ||
2498 | 17 | |||
2499 | 18 | from canonical.launchpad.webapp.publication import LaunchpadBrowserPublication | ||
2500 | 19 | from canonical.launchpad.webapp.servers import ( | ||
2501 | 20 | LaunchpadBrowserRequest, VHostWebServiceRequestPublicationFactory) | ||
2502 | 21 | |||
2503 | 22 | |||
2504 | 23 | class TranslationsLayer(IBrowserRequest, IDefaultBrowserLayer): | ||
2505 | 24 | """The Translations layer.""" | ||
2506 | 25 | |||
2507 | 26 | |||
2508 | 27 | class TranslationsBrowserRequest(LaunchpadBrowserRequest): | ||
2509 | 28 | """Instances of TranslationsBrowserRequest provide `TranslationsLayer`.""" | ||
2510 | 29 | implements(TranslationsLayer) | ||
2511 | 30 | |||
2512 | 31 | def __init__(self, body_instream, environ, response=None): | ||
2513 | 32 | super(TranslationsBrowserRequest, self).__init__( | ||
2514 | 33 | body_instream, environ, response) | ||
2515 | 34 | # Many of the responses from Translations vary based on language. | ||
2516 | 35 | self.response.setHeader( | ||
2517 | 36 | 'Vary', 'Cookie, Authorization, Accept-Language') | ||
2518 | 37 | |||
2519 | 38 | |||
2520 | 39 | def translations_request_publication_factory(): | ||
2521 | 40 | return VHostWebServiceRequestPublicationFactory( | ||
2522 | 41 | 'translations', TranslationsBrowserRequest, | ||
2523 | 42 | LaunchpadBrowserPublication) | ||
2524 | 0 | 43 | ||
2525 | === added file 'lib/lp/translations/tests/test_publisher.py' | |||
2526 | --- lib/lp/translations/tests/test_publisher.py 1970-01-01 00:00:00 +0000 | |||
2527 | +++ lib/lp/translations/tests/test_publisher.py 2010-07-22 20:59:01 +0000 | |||
2528 | @@ -0,0 +1,50 @@ | |||
2529 | 1 | # Copyright 2010 Canonical Ltd. This software is licensed under the | ||
2530 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | ||
2531 | 3 | |||
2532 | 4 | """Tests for translations's custom publications.""" | ||
2533 | 5 | |||
2534 | 6 | __metaclass__ = type | ||
2535 | 7 | |||
2536 | 8 | import StringIO | ||
2537 | 9 | |||
2538 | 10 | from canonical.config import config | ||
2539 | 11 | from canonical.launchpad.layers import WebServiceLayer | ||
2540 | 12 | from canonical.testing.layers import FunctionalLayer | ||
2541 | 13 | |||
2542 | 14 | from lp.testing import TestCase | ||
2543 | 15 | from lp.testing.publication import get_request_and_publication | ||
2544 | 16 | |||
2545 | 17 | from lp.translations.publisher import ( | ||
2546 | 18 | TranslationsLayer, TranslationsBrowserRequest) | ||
2547 | 19 | |||
2548 | 20 | |||
2549 | 21 | class TestRegistration(TestCase): | ||
2550 | 22 | """Translations's publication customizations are installed correctly.""" | ||
2551 | 23 | |||
2552 | 24 | layer = FunctionalLayer | ||
2553 | 25 | |||
2554 | 26 | def test_translations_request_provides_translations_layer(self): | ||
2555 | 27 | # The request constructed for requests to the translations hostname | ||
2556 | 28 | # provides TranslationsLayer. | ||
2557 | 29 | request, publication = get_request_and_publication( | ||
2558 | 30 | host=config.vhost.translations.hostname) | ||
2559 | 31 | self.assertProvides(request, TranslationsLayer) | ||
2560 | 32 | |||
2561 | 33 | def test_translations_host_has_api(self): | ||
2562 | 34 | # Requests to /api on the translations domain are treated as web | ||
2563 | 35 | # service requests. | ||
2564 | 36 | request, publication = get_request_and_publication( | ||
2565 | 37 | host=config.vhost.translations.hostname, | ||
2566 | 38 | extra_environment={'PATH_INFO': '/api/1.0'}) | ||
2567 | 39 | # XXX MichaelHudson, 2010-07-20, bug=607664: WebServiceLayer only | ||
2568 | 40 | # actually provides WebServiceLayer in the sense of verifyObject after | ||
2569 | 41 | # traversal has started. | ||
2570 | 42 | self.assertTrue(WebServiceLayer.providedBy(request)) | ||
2571 | 43 | |||
2572 | 44 | def test_response_should_vary_based_on_language(self): | ||
2573 | 45 | # Responses to requests to translations pages have the 'Vary' header | ||
2574 | 46 | # set to include Accept-Language. | ||
2575 | 47 | request = TranslationsBrowserRequest(StringIO.StringIO(''), {}) | ||
2576 | 48 | self.assertEquals( | ||
2577 | 49 | request.response.getHeader('Vary'), | ||
2578 | 50 | 'Cookie, Authorization, Accept-Language') |
well for starters, please don't add
> +def test_suite(): TestLoader( ).loadTestsFrom Name(__ name__)
> + return unittest.
:P
-Rob