Merge lp:~mwhudson/launchpad/apoca-publish-code into lp:launchpad

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
Reviewer Review Type Date Requested Status
Curtis Hovey (community) code Approve
Review via email: mp+30490@code.launchpad.net

Commit message

Move application specific publishing code into lp.$application.publisher modules

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.publisher modules.

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
Robert Collins (lifeless) wrote :

well for starters, please don't add

> +def test_suite():
> + return unittest.TestLoader().loadTestsFromName(__name__)

:P

-Rob

Revision history for this message
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
=== modified file 'lib/canonical/configure.zcml'
--- lib/canonical/configure.zcml 2010-07-22 01:48:51 +0000
+++ lib/canonical/configure.zcml 2010-07-22 20:59:01 +0000
@@ -85,14 +85,14 @@
85 <browser:defaultView85 <browser:defaultView
86 for="canonical.launchpad.interfaces.ILaunchpadRoot"86 for="canonical.launchpad.interfaces.ILaunchpadRoot"
87 name="specs"87 name="specs"
88 layer="canonical.launchpad.layers.BlueprintsLayer"88 layer="lp.blueprints.publisher.BlueprintsLayer"
89 />89 />
90 <browser:page90 <browser:page
91 name=""91 name=""
92 for="canonical.launchpad.interfaces.ILaunchpadRoot"92 for="canonical.launchpad.interfaces.ILaunchpadRoot"
93 class="canonical.launchpad.browser.launchpad.LaunchpadImageFolder"93 class="canonical.launchpad.browser.launchpad.LaunchpadImageFolder"
94 permission="zope.Public"94 permission="zope.Public"
95 layer="canonical.launchpad.layers.BlueprintsLayer"95 layer="lp.blueprints.publisher.BlueprintsLayer"
96 />96 />
9797
98 <!-- virtual host: code -->98 <!-- virtual host: code -->
@@ -113,42 +113,42 @@
113 <browser:defaultView113 <browser:defaultView
114 for="canonical.launchpad.interfaces.ILaunchpadRoot"114 for="canonical.launchpad.interfaces.ILaunchpadRoot"
115 name="translations"115 name="translations"
116 layer="canonical.launchpad.layers.TranslationsLayer"116 layer="lp.translations.publisher.TranslationsLayer"
117 />117 />
118 <browser:page118 <browser:page
119 name=""119 name=""
120 for="canonical.launchpad.interfaces.ILaunchpadRoot"120 for="canonical.launchpad.interfaces.ILaunchpadRoot"
121 class="canonical.launchpad.browser.launchpad.LaunchpadImageFolder"121 class="canonical.launchpad.browser.launchpad.LaunchpadImageFolder"
122 permission="zope.Public"122 permission="zope.Public"
123 layer="canonical.launchpad.layers.TranslationsLayer"123 layer="lp.translations.publisher.TranslationsLayer"
124 />124 />
125125
126 <!-- virtual host: bugs -->126 <!-- virtual host: bugs -->
127 <browser:defaultView127 <browser:defaultView
128 for="canonical.launchpad.interfaces.ILaunchpadRoot"128 for="canonical.launchpad.interfaces.ILaunchpadRoot"
129 name="bugs"129 name="bugs"
130 layer="canonical.launchpad.layers.BugsLayer"130 layer="lp.bugs.publisher.BugsLayer"
131 />131 />
132 <browser:page132 <browser:page
133 name=""133 name=""
134 for="canonical.launchpad.interfaces.ILaunchpadRoot"134 for="canonical.launchpad.interfaces.ILaunchpadRoot"
135 class="canonical.launchpad.browser.launchpad.LaunchpadImageFolder"135 class="canonical.launchpad.browser.launchpad.LaunchpadImageFolder"
136 permission="zope.Public"136 permission="zope.Public"
137 layer="canonical.launchpad.layers.BugsLayer"137 layer="lp.bugs.publisher.BugsLayer"
138 />138 />
139139
140 <!-- virtual host: answers -->140 <!-- virtual host: answers -->
141 <browser:defaultView141 <browser:defaultView
142 for="canonical.launchpad.interfaces.ILaunchpadRoot"142 for="canonical.launchpad.interfaces.ILaunchpadRoot"
143 name="questions"143 name="questions"
144 layer="canonical.launchpad.layers.AnswersLayer"144 layer="lp.answers.publisher.AnswersLayer"
145 />145 />
146 <browser:page146 <browser:page
147 name=""147 name=""
148 for="canonical.launchpad.interfaces.ILaunchpadRoot"148 for="canonical.launchpad.interfaces.ILaunchpadRoot"
149 class="canonical.launchpad.browser.launchpad.LaunchpadImageFolder"149 class="canonical.launchpad.browser.launchpad.LaunchpadImageFolder"
150 permission="zope.Public"150 permission="zope.Public"
151 layer="canonical.launchpad.layers.AnswersLayer"151 layer="lp.answers.publisher.AnswersLayer"
152 />152 />
153153
154 <include package="canonical.widgets" />154 <include package="canonical.widgets" />
155155
=== modified file 'lib/canonical/launchpad/doc/webapp-publication.txt'
--- lib/canonical/launchpad/doc/webapp-publication.txt 2010-07-20 10:21:01 +0000
+++ lib/canonical/launchpad/doc/webapp-publication.txt 2010-07-22 20:59:01 +0000
@@ -356,30 +356,14 @@
356 ProtocolErrorPublication: status=405356 ProtocolErrorPublication: status=405
357 Allow: GET HEAD POST357 Allow: GET HEAD POST
358358
359 >>> print_request_and_publication('answers.launchpad.dev')
360 AnswersBrowserRequest
361 AnswersPublication
362
363 >>> print_request_and_publication('api.launchpad.dev')359 >>> print_request_and_publication('api.launchpad.dev')
364 WebServiceClientRequest360 WebServiceClientRequest
365 WebServicePublication361 WebServicePublication
366362
367 >>> print_request_and_publication('blueprints.launchpad.dev')
368 BlueprintBrowserRequest
369 BlueprintPublication
370
371 >>> print_request_and_publication('bugs.launchpad.dev')
372 BugsBrowserRequest
373 BugsPublication
374
375 >>> print_request_and_publication('feeds.launchpad.dev')363 >>> print_request_and_publication('feeds.launchpad.dev')
376 FeedsBrowserRequest364 FeedsBrowserRequest
377 FeedsPublication365 FeedsPublication
378366
379 >>> print_request_and_publication('translations.launchpad.dev')
380 TranslationsBrowserRequest
381 TranslationsPublication
382
383The web service RequestPublicationFactory responds to the six most367The web service RequestPublicationFactory responds to the six most
384common HTTP methods, but it will only accept a MIME type of368common HTTP methods, but it will only accept a MIME type of
385application/json.369application/json.
@@ -404,27 +388,15 @@
404 WebServiceClientRequest388 WebServiceClientRequest
405 WebServicePublication389 WebServicePublication
406390
407When a request for '/api' is made to one of the application virtualhost,391When a request for '/api' is made to one of the application
408it is also handled by the web service request and publication:392virtualhosts, such as the application root, it is also handled by the
393web service request and publication:
409394
410 >>> print_request_and_publication(395 >>> print_request_and_publication(
411 ... 'launchpad.dev', method='GET',396 ... 'launchpad.dev', method='GET',
412 ... extra_environment={'PATH_INFO': '/api'})397 ... extra_environment={'PATH_INFO': '/api'})
413 WebServiceClientRequest398 WebServiceClientRequest
414 WebServicePublication399 WebServicePublication
415 >>> for subdomain in [
416 ... 'answers', 'blueprints', 'bugs', 'translations']:
417 ... print_request_and_publication(
418 ... '%s.launchpad.dev' % subdomain, method='GET',
419 ... extra_environment={'PATH_INFO': '/api'})
420 WebServiceClientRequest
421 WebServicePublication
422 WebServiceClientRequest
423 WebServicePublication
424 WebServiceClientRequest
425 WebServicePublication
426 WebServiceClientRequest
427 WebServicePublication
428400
429Requests for '/api' on other hosts like feeds are handled like401Requests for '/api' on other hosts like feeds are handled like
430other requests on these hosts:402other requests on these hosts:
431403
=== modified file 'lib/canonical/launchpad/layers.py'
--- lib/canonical/launchpad/layers.py 2010-07-16 15:35:45 +0000
+++ lib/canonical/launchpad/layers.py 2010-07-22 20:59:01 +0000
@@ -28,23 +28,6 @@
28 """The `LaunchpadLayer` layer."""28 """The `LaunchpadLayer` layer."""
2929
3030
31class TranslationsLayer(LaunchpadLayer):
32 """The `TranslationsLayer` layer."""
33
34
35class BugsLayer(LaunchpadLayer):
36 """The `BugsLayer` layer."""
37
38
39class BlueprintLayer(LaunchpadLayer):
40 """The `BlueprintLayer` layer."""
41BlueprintsLayer = BlueprintLayer
42
43
44class AnswersLayer(LaunchpadLayer):
45 """The `AnswersLayer` layer."""
46
47
48class DebugLayer(Interface):31class DebugLayer(Interface):
49 """The `DebugLayer` layer.32 """The `DebugLayer` layer.
5033
@@ -83,4 +66,3 @@
8366
84class WebServiceLayer(IWebServiceLayer, LaunchpadLayer):67class WebServiceLayer(IWebServiceLayer, LaunchpadLayer):
85 """The layer for web service requests."""68 """The layer for web service requests."""
86
8769
=== modified file 'lib/canonical/launchpad/webapp/meta.zcml'
--- lib/canonical/launchpad/webapp/meta.zcml 2010-07-16 15:13:50 +0000
+++ lib/canonical/launchpad/webapp/meta.zcml 2010-07-22 20:59:01 +0000
@@ -72,7 +72,7 @@
72 <directive72 <directive
73 namespace="http://namespaces.zope.org/zope"73 namespace="http://namespaces.zope.org/zope"
74 name="publisher"74 name="publisher"
75 schema="canonical.launchpad.webapp.metazcml.ILaunchpadPublicationDirective"75 schema="zope.app.publication.metadirectives.IRequestPublicationDirective"
76 handler="canonical.launchpad.webapp.metazcml.launchpadPublisher"76 handler="canonical.launchpad.webapp.metazcml.launchpadPublisher"
77 />77 />
7878
7979
=== modified file 'lib/canonical/launchpad/webapp/metazcml.py'
--- lib/canonical/launchpad/webapp/metazcml.py 2010-07-16 15:35:45 +0000
+++ lib/canonical/launchpad/webapp/metazcml.py 2010-07-22 20:59:01 +0000
@@ -11,7 +11,6 @@
11from zope.app.file.image import Image11from zope.app.file.image import Image
12from zope.app.pagetemplate.engine import TrustedEngine12from zope.app.pagetemplate.engine import TrustedEngine
13from zope.app.publication.metaconfigure import publisher13from zope.app.publication.metaconfigure import publisher
14from zope.app.publication.metadirectives import IRequestPublicationDirective
15from zope.component import getUtility14from zope.component import getUtility
16from zope.component.security import PublicPermission15from zope.component.security import PublicPermission
17from zope.component.zcml import adapter, handler, utility, view16from zope.component.zcml import adapter, handler, utility, view
@@ -21,7 +20,7 @@
21from zope.publisher.interfaces.browser import (20from zope.publisher.interfaces.browser import (
22 IBrowserPublisher, IBrowserRequest, IDefaultBrowserLayer)21 IBrowserPublisher, IBrowserRequest, IDefaultBrowserLayer)
23from zope.publisher.interfaces.xmlrpc import IXMLRPCRequest22from zope.publisher.interfaces.xmlrpc import IXMLRPCRequest
24from zope.schema import Int, TextLine23from zope.schema import TextLine
25from zope.security.checker import Checker, CheckerPublic24from zope.security.checker import Checker, CheckerPublic
26from zope.security.interfaces import IPermission25from zope.security.interfaces import IPermission
27from zope.security.permission import Permission26from zope.security.permission import Permission
@@ -35,7 +34,6 @@
35from z3c.ptcompat.zcml import page_directive as original_page34from z3c.ptcompat.zcml import page_directive as original_page
36from z3c.ptcompat.zcml import pages_directive as original_pages35from z3c.ptcompat.zcml import pages_directive as original_pages
3736
38from canonical.config import config
39from canonical.launchpad.layers import FeedsLayer37from canonical.launchpad.layers import FeedsLayer
40from canonical.launchpad.webapp.interfaces import (38from canonical.launchpad.webapp.interfaces import (
41 IApplicationMenu, IAuthorization, ICanonicalUrlData, IContextMenu,39 IApplicationMenu, IAuthorization, ICanonicalUrlData, IContextMenu,
@@ -48,10 +46,12 @@
4846
49 module = GlobalObject(title=u'module', required=True)47 module = GlobalObject(title=u'module', required=True)
5048
49
51def _isAuthorization(module_member):50def _isAuthorization(module_member):
52 return (type(module_member) is type and51 return (type(module_member) is type and
53 IAuthorization.implementedBy(module_member))52 IAuthorization.implementedBy(module_member))
5453
54
55def authorizations(_context, module):55def authorizations(_context, module):
56 if not inspect.ismodule(module):56 if not inspect.ismodule(module):
57 raise TypeError("module attribute must be a module: %s, %s" %57 raise TypeError("module attribute must be a module: %s, %s" %
@@ -100,6 +100,7 @@
100 raise RuntimeError(100 raise RuntimeError(
101 "unrecognised discriminator name", name)101 "unrecognised discriminator name", name)
102102
103
103class SecuredUtilityDirective:104class SecuredUtilityDirective:
104105
105 def __init__(self, _context, provides, class_=None, component=None,106 def __init__(self, _context, provides, class_=None, component=None,
@@ -131,11 +132,10 @@
131 # of the zcml.132 # of the zcml.
132 checker = Checker(133 checker = Checker(
133 self.permission_collector.get_permissions,134 self.permission_collector.get_permissions,
134 self.permission_collector.set_permissions135 self.permission_collector.set_permissions)
135 )
136 component = ProxyFactory(self.component, checker=checker)136 component = ProxyFactory(self.component, checker=checker)
137 utility(self._context, self.provides, component=component,137 utility(
138 name=self.name)138 self._context, self.provides, component=component, name=self.name)
139 return ()139 return ()
140140
141141
@@ -144,29 +144,24 @@
144144
145 for_ = GlobalObject(145 for_ = GlobalObject(
146 title=u"Specification of the object that has this canonical url",146 title=u"Specification of the object that has this canonical url",
147 required=True147 required=True)
148 )
149148
150 urldata = GlobalObject(149 urldata = GlobalObject(
151 title=u"Adapter to ICanonicalUrlData for this object.",150 title=u"Adapter to ICanonicalUrlData for this object.",
152 required=False151 required=False)
153 )
154152
155 path_expression = TextLine(153 path_expression = TextLine(
156 title=u"TALES expression that evaluates to the path"154 title=u"TALES expression that evaluates to the path"
157 " relative to the parent object.",155 " relative to the parent object.",
158 required=False156 required=False)
159 )
160157
161 attribute_to_parent = PythonIdentifier(158 attribute_to_parent = PythonIdentifier(
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",
163 required=False160 required=False)
164 )
165161
166 parent_utility = GlobalObject(162 parent_utility = GlobalObject(
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",
168 required=False164 required=False)
169 )
170165
171 rootsite = PythonIdentifier(166 rootsite = PythonIdentifier(
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."
@@ -182,14 +177,12 @@
182 generic mechanism, what that 'something' is isn't important.177 generic mechanism, what that 'something' is isn't important.
183 """178 """
184 module = GlobalObject(179 module = GlobalObject(
185 title=u"Module in which the classes are found."180 title=u"Module in which the classes are found.")
186 )
187181
188 classes = Tokens(182 classes = Tokens(
189 value_type=PythonIdentifier(),183 value_type=PythonIdentifier(),
190 title=u"Space separated list of classes to register.",184 title=u"Space separated list of classes to register.",
191 required=True185 required=True)
192 )
193186
194187
195class IMenusDirective(IGlueDirective):188class IMenusDirective(IGlueDirective):
@@ -208,13 +201,11 @@
208201
209 for_ = GlobalObject(202 for_ = GlobalObject(
210 title=u"Specification of the object that has this favicon",203 title=u"Specification of the object that has this favicon",
211 required=True204 required=True)
212 )
213205
214 file = Path(206 file = Path(
215 title=u"Path to the image file",207 title=u"Path to the image file",
216 required=True208 required=True)
217 )
218209
219210
220def menus(_context, module, classes):211def menus(_context, module, classes):
@@ -307,6 +298,7 @@
307class InterfaceInstanceDispatcher:298class InterfaceInstanceDispatcher:
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.
309 """300 """
301
310 def __init__(self, interface, instance):302 def __init__(self, interface, instance):
311 self.interface = interface303 self.interface = interface
312 self.instance = instance304 self.instance = instance
@@ -379,6 +371,7 @@
379 _for = for_371 _for = for_
380 _compiled_path_expression = compiled_path_expression372 _compiled_path_expression = compiled_path_expression
381 rootsite = rootsite_373 rootsite = rootsite_
374
382 @property375 @property
383 def inside(self):376 def inside(self):
384 return getattr(self.context, attribute_to_parent)377 return getattr(self.context, attribute_to_parent)
@@ -387,6 +380,7 @@
387 _for = for_380 _for = for_
388 _compiled_path_expression = compiled_path_expression381 _compiled_path_expression = compiled_path_expression
389 rootsite = rootsite_382 rootsite = rootsite_
383
390 @property384 @property
391 def inside(self):385 def inside(self):
392 return getUtility(parent_utility)386 return getUtility(parent_utility)
@@ -397,17 +391,18 @@
397391
398392
399class FaviconRendererBase:393class FaviconRendererBase:
400
401 # subclasses must provide a 'fileobj' member that has 'contentType'394 # subclasses must provide a 'fileobj' member that has 'contentType'
402 # and 'data' attributes.395 # and 'data' attributes.
403396
404 def __call__(self):397 def __call__(self):
405 self.request.response.setHeader('Content-type',398 self.request.response.setHeader(
406 self.file.contentType)399 'Content-type', self.file.contentType)
407 return self.file.data400 return self.file.data
408401
402
409def favicon(_context, for_, file):403def favicon(_context, for_, file):
410 fileobj = Image(open(file, 'rb').read())404 fileobj = Image(open(file, 'rb').read())
405
411 class Favicon(FaviconRendererBase):406 class Favicon(FaviconRendererBase):
412 file = fileobj407 file = fileobj
413408
@@ -434,8 +429,7 @@
434 layer=IDefaultBrowserLayer, template=None, class_=None,429 layer=IDefaultBrowserLayer, template=None, class_=None,
435 allowed_interface=None, allowed_attributes=None,430 allowed_interface=None, allowed_attributes=None,
436 attribute='__call__', menu=None, title=None,431 attribute='__call__', menu=None, title=None,
437 facet=None432 facet=None):
438 ):
439 """Like the standard 'page' directive, but with an added 'facet' optional433 """Like the standard 'page' directive, but with an added 'facet' optional
440 argument.434 argument.
441435
@@ -503,7 +497,7 @@
503497
504 for_ = GlobalObject(498 for_ = GlobalObject(
505 title=u"Specification of the object that has the renamed page",499 title=u"Specification of the object that has the renamed page",
506 required=True )500 required=True)
507501
508 layer = GlobalInterface(502 layer = GlobalInterface(
509 title=u"The layer the renamed page is in.",503 title=u"The layer the renamed page is in.",
@@ -532,6 +526,7 @@
532def renamed_page(_context, for_, name, new_name, layer=IDefaultBrowserLayer,526def renamed_page(_context, for_, name, new_name, layer=IDefaultBrowserLayer,
533 rootsite=None):527 rootsite=None):
534 """Will provide a `RedirectView` that will redirect to the new_name."""528 """Will provide a `RedirectView` that will redirect to the new_name."""
529
535 def renamed_factory(context, request):530 def renamed_factory(context, request):
536 return RenamedView(531 return RenamedView(
537 context, request, new_name=new_name, rootsite=rootsite)532 context, request, new_name=new_name, rootsite=rootsite)
@@ -656,15 +651,14 @@
656 utility(_context, ILaunchpadPermission, permission, name=id)651 utility(_context, ILaunchpadPermission, permission, name=id)
657652
658653
659class ILaunchpadPublicationDirective(IRequestPublicationDirective):
660
661 priorty = Int(required=False)
662
663_arbitrary_priority = 12654_arbitrary_priority = 12
664655
665656
666def launchpadPublisher(_context, name, factory, methods=['*'],657def launchpadPublisher(_context, name, factory, methods=['*'],
667 mimetypes=['*'], priority=None):658 mimetypes=['*'], priority=None):
659 # This overrides zope's definition of the <publisher> directive to supply
660 # an arbitrary unique priority if none is explicitly supplied -- we don't
661 # care about the priority in Launchpad but it needs to be unique.
668 global _arbitrary_priority662 global _arbitrary_priority
669 if priority is None:663 if priority is None:
670 _arbitrary_priority += 1664 _arbitrary_priority += 1
671665
=== modified file 'lib/canonical/launchpad/webapp/servers.py'
--- lib/canonical/launchpad/webapp/servers.py 2010-07-22 01:48:51 +0000
+++ lib/canonical/launchpad/webapp/servers.py 2010-07-22 20:59:01 +0000
@@ -352,7 +352,7 @@
352 else:352 else:
353 request_factory = ProtocolErrorRequest353 request_factory = ProtocolErrorRequest
354 publication_factory = ProtocolErrorPublicationFactory(354 publication_factory = ProtocolErrorPublicationFactory(
355 405, headers={'Allow':" ".join(self.methods)})355 405, headers={'Allow': " ".join(self.methods)})
356 factories = (request_factory, publication_factory)356 factories = (request_factory, publication_factory)
357357
358 return factories358 return factories
@@ -614,6 +614,7 @@
614 """See `ISynchronizer`."""614 """See `ISynchronizer`."""
615 pass615 pass
616616
617
617class BrowserFormNG:618class BrowserFormNG:
618 """Wrapper that provides IBrowserFormNG around a regular form dict."""619 """Wrapper that provides IBrowserFormNG around a regular form dict."""
619620
@@ -680,6 +681,7 @@
680 def install(cls):681 def install(cls):
681 """Install the monkey patch."""682 """Install the monkey patch."""
682 assert not cls.installed, "Monkey patch is already installed."683 assert not cls.installed, "Monkey patch is already installed."
684
683 def _getFormInput_single(self):685 def _getFormInput_single(self):
684 """Return the submitted form value.686 """Return the submitted form value.
685687
@@ -975,9 +977,7 @@
975 userid,977 userid,
976 pageid,978 pageid,
977 referer,979 referer,
978 user_agent980 user_agent))
979 )
980 )
981981
982982
983http = wsgi.ServerType(983http = wsgi.ServerType(
@@ -1015,52 +1015,6 @@
1015class MainLaunchpadPublication(LaunchpadBrowserPublication):1015class MainLaunchpadPublication(LaunchpadBrowserPublication):
1016 """The publication used for the main Launchpad site."""1016 """The publication used for the main Launchpad site."""
10171017
1018# ---- blueprint
1019
1020class BlueprintBrowserRequest(LaunchpadBrowserRequest):
1021 implements(canonical.launchpad.layers.BlueprintLayer)
1022
1023class BlueprintPublication(LaunchpadBrowserPublication):
1024 """The publication used for the Blueprint site."""
1025
1026# ---- translations
1027
1028class TranslationsPublication(LaunchpadBrowserPublication):
1029 """The publication used for the Translations site."""
1030
1031class TranslationsBrowserRequest(LaunchpadBrowserRequest):
1032 implements(canonical.launchpad.layers.TranslationsLayer)
1033
1034 def __init__(self, body_instream, environ, response=None):
1035 super(TranslationsBrowserRequest, self).__init__(
1036 body_instream, environ, response)
1037 # Some of the responses from translations vary based on language.
1038 self.response.setHeader(
1039 'Vary', 'Cookie, Authorization, Accept-Language')
1040
1041# ---- bugs
1042
1043class BugsPublication(LaunchpadBrowserPublication):
1044 """The publication used for the Bugs site."""
1045
1046class BugsBrowserRequest(LaunchpadBrowserRequest):
1047 implements(canonical.launchpad.layers.BugsLayer)
1048
1049# ---- answers
1050
1051class AnswersPublication(LaunchpadBrowserPublication):
1052 """The publication used for the Answers site."""
1053
1054class AnswersBrowserRequest(LaunchpadBrowserRequest):
1055 implements(canonical.launchpad.layers.AnswersLayer)
1056
1057 def __init__(self, body_instream, environ, response=None):
1058 super(AnswersBrowserRequest, self).__init__(
1059 body_instream, environ, response)
1060 # Many of the responses from Answers vary based on language.
1061 self.response.setHeader(
1062 'Vary', 'Cookie, Authorization, Accept-Language')
1063
10641018
1065class AccountPrincipalMixin:1019class AccountPrincipalMixin:
1066 """Mixin for publication that works with person-less accounts."""1020 """Mixin for publication that works with person-less accounts."""
@@ -1326,10 +1280,10 @@
13261280
1327class PublicXMLRPCPublication(LaunchpadBrowserPublication):1281class PublicXMLRPCPublication(LaunchpadBrowserPublication):
1328 """The publication used for public XML-RPC requests."""1282 """The publication used for public XML-RPC requests."""
1283
1329 def handleException(self, object, request, exc_info, retry_allowed=True):1284 def handleException(self, object, request, exc_info, retry_allowed=True):
1330 LaunchpadBrowserPublication.handleException(1285 LaunchpadBrowserPublication.handleException(
1331 self, object, request, exc_info, retry_allowed1286 self, object, request, exc_info, retry_allowed)
1332 )
1333 OpStats.stats['xml-rpc faults'] += 11287 OpStats.stats['xml-rpc faults'] += 1
13341288
1335 def endRequest(self, request, object):1289 def endRequest(self, request, object):
@@ -1475,16 +1429,11 @@
1475 factories = [1429 factories = [
1476 VWSHRP('mainsite', LaunchpadBrowserRequest, MainLaunchpadPublication,1430 VWSHRP('mainsite', LaunchpadBrowserRequest, MainLaunchpadPublication,
1477 handle_default_host=True),1431 handle_default_host=True),
1478 VWSHRP('blueprints', BlueprintBrowserRequest, BlueprintPublication),
1479 VWSHRP('translations', TranslationsBrowserRequest,
1480 TranslationsPublication),
1481 VWSHRP('bugs', BugsBrowserRequest, BugsPublication),
1482 VWSHRP('answers', AnswersBrowserRequest, AnswersPublication),
1483 VHRP('feeds', FeedsBrowserRequest, FeedsPublication),1432 VHRP('feeds', FeedsBrowserRequest, FeedsPublication),
1484 WebServiceRequestPublicationFactory(1433 WebServiceRequestPublicationFactory(
1485 'api', WebServiceClientRequest, WebServicePublication),1434 'api', WebServiceClientRequest, WebServicePublication),
1486 XMLRPCRequestPublicationFactory(1435 XMLRPCRequestPublicationFactory(
1487 'xmlrpc', PublicXMLRPCRequest, PublicXMLRPCPublication)1436 'xmlrpc', PublicXMLRPCRequest, PublicXMLRPCPublication),
1488 ]1437 ]
14891438
1490 if config.launchpad.enable_test_openid_provider:1439 if config.launchpad.enable_test_openid_provider:
14911440
=== modified file 'lib/canonical/launchpad/webapp/tests/test_servers.py'
--- lib/canonical/launchpad/webapp/tests/test_servers.py 2010-07-14 14:11:15 +0000
+++ lib/canonical/launchpad/webapp/tests/test_servers.py 2010-07-22 20:59:01 +0000
@@ -21,9 +21,8 @@
21from lp.testing import TestCase21from lp.testing import TestCase
2222
23from canonical.launchpad.webapp.servers import (23from canonical.launchpad.webapp.servers import (
24 AnswersBrowserRequest, ApplicationServerSettingRequestFactory,24 ApplicationServerSettingRequestFactory, LaunchpadBrowserRequest,
25 BugsBrowserRequest, BugsPublication, LaunchpadBrowserRequest,25 VHostWebServiceRequestPublicationFactory,
26 TranslationsBrowserRequest, VHostWebServiceRequestPublicationFactory,
27 VirtualHostRequestPublicationFactory, WebServiceRequestPublicationFactory,26 VirtualHostRequestPublicationFactory, WebServiceRequestPublicationFactory,
28 WebServiceClientRequest, WebServicePublication, WebServiceTestRequest)27 WebServiceClientRequest, WebServicePublication, WebServiceTestRequest)
2928
@@ -99,35 +98,42 @@
9998
100class TestVhostWebserviceFactory(WebServiceTestCase):99class TestVhostWebserviceFactory(WebServiceTestCase):
101100
101 class VHostTestBrowserRequest(LaunchpadBrowserRequest):
102 pass
103
104 class VHostTestPublication(LaunchpadBrowserRequest):
105 pass
106
102 def setUp(self):107 def setUp(self):
103 super(TestVhostWebserviceFactory, self).setUp()108 super(TestVhostWebserviceFactory, self).setUp()
109 # XXX We have to use a real hostname.
104 self.factory = VHostWebServiceRequestPublicationFactory(110 self.factory = VHostWebServiceRequestPublicationFactory(
105 'bugs', BugsBrowserRequest, BugsPublication)111 'bugs', self.VHostTestBrowserRequest, self.VHostTestPublication)
106112
107 def wsgi_env(self, path, method='GET'):113 def wsgi_env(self, path, method='GET'):
108 """Simulate a WSGI application environment."""114 """Simulate a WSGI application environment."""
109 return {115 return {
110 'PATH_INFO': path,116 'PATH_INFO': path,
111 'HTTP_HOST': 'bugs.launchpad.dev',117 'HTTP_HOST': 'bugs.launchpad.dev',
112 'REQUEST_METHOD': method118 'REQUEST_METHOD': method,
113 }119 }
114120
115 @property121 @property
116 def working_api_path(self):122 def api_path(self):
117 """A path to the webservice API that should work every time."""123 """Requests to this path should be treated as webservice requests."""
118 return '/' + getUtility(IWebServiceConfiguration).path_override124 return '/' + getUtility(IWebServiceConfiguration).path_override
119125
120 @property126 @property
121 def failing_api_path(self):127 def non_api_path(self):
122 """A path that should not work with the webservice API."""128 """Requests to this path should not be treated as webservice requests.
129 """
123 return '/foo'130 return '/foo'
124131
125 def test_factory_produces_webservice_objects(self):132 def test_factory_produces_webservice_objects(self):
126 """The factory should produce WebService request and publication133 """The factory should produce WebService request and publication
127 objects for requests to the /api root URL.134 objects for requests to the /api root URL.
128 """135 """
129 env = self.wsgi_env(136 env = self.wsgi_env(self.api_path)
130 '/' + getUtility(IWebServiceConfiguration).path_override)
131137
132 # Necessary preamble and sanity check. We need to call138 # Necessary preamble and sanity check. We need to call
133 # the factory's canHandle() method with an appropriate139 # the factory's canHandle() method with an appropriate
@@ -153,7 +159,7 @@
153 specified in it's constructor if the request is not bound for the159 specified in it's constructor if the request is not bound for the
154 web service.160 web service.
155 """161 """
156 env = self.wsgi_env('/foo')162 env = self.wsgi_env(self.non_api_path)
157 self.assert_(self.factory.canHandle(env),163 self.assert_(self.factory.canHandle(env),
158 "Sanity check: The factory should be able to handle requests.")164 "Sanity check: The factory should be able to handle requests.")
159165
@@ -162,12 +168,12 @@
162 # We need to unwrap the real request factory.168 # We need to unwrap the real request factory.
163 request_factory = wrapped_factory.requestfactory169 request_factory = wrapped_factory.requestfactory
164170
165 self.assertEqual(request_factory, BugsBrowserRequest,171 self.assertEqual(request_factory, self.VHostTestBrowserRequest,
166 "Requests to normal paths should return a Bugs "172 "Requests to normal paths should return a VHostTest "
167 "request object.")173 "request object.")
168 self.assertEqual(174 self.assertEqual(
169 publication_factory, BugsPublication,175 publication_factory, self.VHostTestPublication,
170 "Requests to normal paths should return a Bugs "176 "Requests to normal paths should return a VHostTest "
171 "publication object.")177 "publication object.")
172178
173 def test_factory_processes_webservice_http_methods(self):179 def test_factory_processes_webservice_http_methods(self):
@@ -177,7 +183,7 @@
177 allowed_methods = WebServiceRequestPublicationFactory.default_methods183 allowed_methods = WebServiceRequestPublicationFactory.default_methods
178184
179 for method in allowed_methods:185 for method in allowed_methods:
180 env = self.wsgi_env(self.working_api_path, method)186 env = self.wsgi_env(self.api_path, method)
181 self.assert_(self.factory.canHandle(env),187 self.assert_(self.factory.canHandle(env),
182 "Sanity check")188 "Sanity check")
183 # Returns a tuple of (request_factory, publication_factory).189 # Returns a tuple of (request_factory, publication_factory).
@@ -198,7 +204,7 @@
198 denied_methods = set(ws_methods) - set(vhost_methods)204 denied_methods = set(ws_methods) - set(vhost_methods)
199205
200 for method in denied_methods:206 for method in denied_methods:
201 env = self.wsgi_env(self.failing_api_path, method)207 env = self.wsgi_env(self.non_api_path, method)
202 self.assert_(self.factory.canHandle(env),208 self.assert_(self.factory.canHandle(env),
203 "Sanity check")209 "Sanity check")
204 # Returns a tuple of (request_factory, publication_factory).210 # Returns a tuple of (request_factory, publication_factory).
@@ -221,9 +227,6 @@
221 self.assert_(227 self.assert_(
222 self.factory.isWebServicePath('/api'),228 self.factory.isWebServicePath('/api'),
223 "The factory should handle URLs that start with /api.")229 "The factory should handle URLs that start with /api.")
224 self.assert_(
225 self.factory.isWebServicePath('/api/'),
226 "The factory should handle URLs that start with /api.")
227230
228 self.assert_(231 self.assert_(
229 self.factory.isWebServicePath('/api/foo'),232 self.factory.isWebServicePath('/api/foo'),
@@ -263,8 +266,10 @@
263 implements(IGenericCollection)266 implements(IGenericCollection)
264267
265 class MyRootResource(RootResource):268 class MyRootResource(RootResource):
269
266 def _build_top_level_objects(self):270 def _build_top_level_objects(self):
267 return ({'foo' : (IGenericEntry, GenericCollection())}, {})271 return ({'foo': (IGenericEntry, GenericCollection())}, {})
272
268 getGlobalSiteManager().registerUtility(273 getGlobalSiteManager().registerUtility(
269 MyRootResource(), IServiceRootResource)274 MyRootResource(), IServiceRootResource)
270275
@@ -385,26 +390,6 @@
385 self.assertEquals(self.request.getNearest(IThing), (None, None))390 self.assertEquals(self.request.getNearest(IThing), (None, None))
386391
387392
388class TestAnswersBrowserRequest(TestCase):
389 """Tests for the Answers request class."""
390
391 def test_response_should_vary_based_on_language(self):
392 request = AnswersBrowserRequest(StringIO.StringIO(''), {})
393 self.assertEquals(
394 request.response.getHeader('Vary'),
395 'Cookie, Authorization, Accept-Language')
396
397
398class TestTranslationsBrowserRequest(TestCase):
399 """Tests for the Translations request class."""
400
401 def test_response_should_vary_based_on_language(self):
402 request = TranslationsBrowserRequest(StringIO.StringIO(''), {})
403 self.assertEquals(
404 request.response.getHeader('Vary'),
405 'Cookie, Authorization, Accept-Language')
406
407
408class TestLaunchpadBrowserRequest(TestCase):393class TestLaunchpadBrowserRequest(TestCase):
409394
410 def prepareRequest(self, form):395 def prepareRequest(self, form):
411396
=== modified file 'lib/canonical/launchpad/zcml/marketing.zcml'
--- lib/canonical/launchpad/zcml/marketing.zcml 2010-07-16 15:40:14 +0000
+++ lib/canonical/launchpad/zcml/marketing.zcml 2010-07-22 20:59:01 +0000
@@ -26,14 +26,14 @@
26 <!-- Marketing material for Answers. -->26 <!-- Marketing material for Answers. -->
27 <browser:renamed-page27 <browser:renamed-page
28 for="canonical.launchpad.webapp.interfaces.ILaunchpadApplication"28 for="canonical.launchpad.webapp.interfaces.ILaunchpadApplication"
29 layer="canonical.launchpad.layers.AnswersLayer"29 layer="lp.answers.publisher.AnswersLayer"
30 name="+about"30 name="+about"
31 new_name="+tour/community-support"31 new_name="+tour/community-support"
32 rootsite="mainsite"32 rootsite="mainsite"
33 />33 />
34 <browser:renamed-page34 <browser:renamed-page
35 for="canonical.launchpad.webapp.interfaces.ILaunchpadApplication"35 for="canonical.launchpad.webapp.interfaces.ILaunchpadApplication"
36 layer="canonical.launchpad.layers.AnswersLayer"36 layer="lp.answers.publisher.AnswersLayer"
37 name="+faq"37 name="+faq"
38 new_name="+tour/community-support"38 new_name="+tour/community-support"
39 rootsite="mainsite"39 rootsite="mainsite"
@@ -43,20 +43,20 @@
43 new_name="+tour/community-support"43 new_name="+tour/community-support"
44 rootsite="mainsite"44 rootsite="mainsite"
45 for="canonical.launchpad.webapp.interfaces.ILaunchpadApplication"45 for="canonical.launchpad.webapp.interfaces.ILaunchpadApplication"
46 layer="canonical.launchpad.layers.AnswersLayer"46 layer="lp.answers.publisher.AnswersLayer"
47 />47 />
4848
49 <!-- Marketing material for Blueprints. -->49 <!-- Marketing material for Blueprints. -->
50 <browser:renamed-page50 <browser:renamed-page
51 for="canonical.launchpad.webapp.interfaces.ILaunchpadApplication"51 for="canonical.launchpad.webapp.interfaces.ILaunchpadApplication"
52 layer="canonical.launchpad.layers.BlueprintsLayer"52 layer="lp.blueprints.publisher.BlueprintsLayer"
53 name="+about"53 name="+about"
54 new_name="+tour/feature-tracking"54 new_name="+tour/feature-tracking"
55 rootsite="mainsite"55 rootsite="mainsite"
56 />56 />
57 <browser:renamed-page57 <browser:renamed-page
58 for="canonical.launchpad.webapp.interfaces.ILaunchpadApplication"58 for="canonical.launchpad.webapp.interfaces.ILaunchpadApplication"
59 layer="canonical.launchpad.layers.BlueprintsLayer"59 layer="lp.blueprints.publisher.BlueprintsLayer"
60 name="+faq"60 name="+faq"
61 new_name="+tour/feature-tracking"61 new_name="+tour/feature-tracking"
62 rootsite="mainsite"62 rootsite="mainsite"
@@ -64,7 +64,7 @@
64 <browser:renamed-page64 <browser:renamed-page
65 name="+tour"65 name="+tour"
66 for="canonical.launchpad.webapp.interfaces.ILaunchpadApplication"66 for="canonical.launchpad.webapp.interfaces.ILaunchpadApplication"
67 layer="canonical.launchpad.layers.BlueprintsLayer"67 layer="lp.blueprints.publisher.BlueprintsLayer"
68 new_name="+tour/feature-tracking"68 new_name="+tour/feature-tracking"
69 rootsite="mainsite"69 rootsite="mainsite"
70 />70 />
@@ -72,14 +72,14 @@
72 <!-- Marketing material for Bugs. -->72 <!-- Marketing material for Bugs. -->
73 <browser:renamed-page73 <browser:renamed-page
74 for="canonical.launchpad.webapp.interfaces.ILaunchpadApplication"74 for="canonical.launchpad.webapp.interfaces.ILaunchpadApplication"
75 layer="canonical.launchpad.layers.BugsLayer"75 layer="lp.bugs.publisher.BugsLayer"
76 name="+about"76 name="+about"
77 new_name="+tour/bugs"77 new_name="+tour/bugs"
78 rootsite="mainsite"78 rootsite="mainsite"
79 />79 />
80 <browser:renamed-page80 <browser:renamed-page
81 for="canonical.launchpad.webapp.interfaces.ILaunchpadApplication"81 for="canonical.launchpad.webapp.interfaces.ILaunchpadApplication"
82 layer="canonical.launchpad.layers.BugsLayer"82 layer="lp.bugs.publisher.BugsLayer"
83 name="+faq"83 name="+faq"
84 new_name="+tour/bugs"84 new_name="+tour/bugs"
85 rootsite="mainsite"85 rootsite="mainsite"
@@ -87,7 +87,7 @@
87 <browser:renamed-page87 <browser:renamed-page
88 name="+tour"88 name="+tour"
89 for="canonical.launchpad.webapp.interfaces.ILaunchpadApplication"89 for="canonical.launchpad.webapp.interfaces.ILaunchpadApplication"
90 layer="canonical.launchpad.layers.BugsLayer"90 layer="lp.bugs.publisher.BugsLayer"
91 new_name="+tour/bugs"91 new_name="+tour/bugs"
92 rootsite="mainsite"92 rootsite="mainsite"
93 />93 />
@@ -119,14 +119,14 @@
119 <!-- Marketing material for Translations. -->119 <!-- Marketing material for Translations. -->
120 <browser:renamed-page120 <browser:renamed-page
121 for="canonical.launchpad.webapp.interfaces.ILaunchpadApplication"121 for="canonical.launchpad.webapp.interfaces.ILaunchpadApplication"
122 layer="canonical.launchpad.layers.TranslationsLayer"122 layer="lp.translations.publisher.TranslationsLayer"
123 name="+about"123 name="+about"
124 new_name="+tour/translation"124 new_name="+tour/translation"
125 rootsite="mainsite"125 rootsite="mainsite"
126 />126 />
127 <browser:renamed-page127 <browser:renamed-page
128 for="canonical.launchpad.webapp.interfaces.ILaunchpadApplication"128 for="canonical.launchpad.webapp.interfaces.ILaunchpadApplication"
129 layer="canonical.launchpad.layers.TranslationsLayer"129 layer="lp.translations.publisher.TranslationsLayer"
130 name="+faq"130 name="+faq"
131 new_name="+tour/translation"131 new_name="+tour/translation"
132 rootsite="mainsite"132 rootsite="mainsite"
@@ -134,7 +134,7 @@
134 <browser:renamed-page134 <browser:renamed-page
135 name="+tour"135 name="+tour"
136 for="canonical.launchpad.webapp.interfaces.ILaunchpadApplication"136 for="canonical.launchpad.webapp.interfaces.ILaunchpadApplication"
137 layer="canonical.launchpad.layers.TranslationsLayer"137 layer="lp.translations.publisher.TranslationsLayer"
138 new_name="+tour/translation"138 new_name="+tour/translation"
139 rootsite="mainsite"139 rootsite="mainsite"
140 />140 />
141141
=== modified file 'lib/lp/answers/browser/configure.zcml'
--- lib/lp/answers/browser/configure.zcml 2009-11-22 17:28:49 +0000
+++ lib/lp/answers/browser/configure.zcml 2010-07-22 20:59:01 +0000
@@ -14,7 +14,7 @@
14 IQuestionCollection. -->14 IQuestionCollection. -->
15 <browser:defaultView15 <browser:defaultView
16 for="lp.answers.interfaces.questioncollection.IQuestionCollection"16 for="lp.answers.interfaces.questioncollection.IQuestionCollection"
17 layer="canonical.launchpad.layers.AnswersLayer"17 layer="lp.answers.publisher.AnswersLayer"
18 name="+tickets"18 name="+tickets"
19 />19 />
20 <browser:page20 <browser:page
@@ -351,7 +351,7 @@
351351
352 <browser:defaultView352 <browser:defaultView
353 for="canonical.launchpad.interfaces.IPerson"353 for="canonical.launchpad.interfaces.IPerson"
354 layer="canonical.launchpad.layers.AnswersLayer"354 layer="lp.answers.publisher.AnswersLayer"
355 name="+questions"355 name="+questions"
356 />356 />
357357
358358
=== modified file 'lib/lp/answers/browser/tests/views.txt'
--- lib/lp/answers/browser/tests/views.txt 2010-04-16 15:06:55 +0000
+++ lib/lp/answers/browser/tests/views.txt 2010-07-22 20:59:01 +0000
@@ -860,7 +860,7 @@
860the question listing table. Products display the default columns of860the question listing table. Products display the default columns of
861Summary, Created, Submitter, Assignee, and Status.861Summary, Created, Submitter, Assignee, and Status.
862862
863 >>> from canonical.launchpad.layers import AnswersLayer863 >>> from lp.answers.publisher import AnswersLayer
864 >>> from canonical.launchpad.testing.pages import (864 >>> from canonical.launchpad.testing.pages import (
865 ... extract_text, find_tag_by_id)865 ... extract_text, find_tag_by_id)
866866
867867
=== modified file 'lib/lp/answers/configure.zcml'
--- lib/lp/answers/configure.zcml 2010-02-17 11:19:42 +0000
+++ lib/lp/answers/configure.zcml 2010-07-22 20:59:01 +0000
@@ -10,6 +10,10 @@
1010
11 <include package=".browser" />11 <include package=".browser" />
1212
13 <publisher
14 name="answers"
15 factory="lp.answers.publisher.answers_request_publication_factory"/>
16
13 <subscriber17 <subscriber
14 for=".interfaces.question.IQuestion18 for=".interfaces.question.IQuestion
15 lazr.lifecycle.interfaces.IObjectCreatedEvent"19 lazr.lifecycle.interfaces.IObjectCreatedEvent"
@@ -235,7 +239,7 @@
235239
236240
237 <lp:help-folder241 <lp:help-folder
238 folder="help" type="canonical.launchpad.layers.AnswersLayer" />242 folder="help" type="lp.answers.publisher.AnswersLayer" />
239 <adapter243 <adapter
240 name="answers"244 name="answers"
241 provides="canonical.launchpad.webapp.interfaces.IBreadcrumb"245 provides="canonical.launchpad.webapp.interfaces.IBreadcrumb"
242246
=== added file 'lib/lp/answers/publisher.py'
--- lib/lp/answers/publisher.py 1970-01-01 00:00:00 +0000
+++ lib/lp/answers/publisher.py 2010-07-22 20:59:01 +0000
@@ -0,0 +1,41 @@
1# Copyright 2010 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).
3
4"""Answers's custom publication."""
5
6__metaclass__ = type
7__all__ = [
8 'AnswersBrowserRequest',
9 'AnswersLayer',
10 'answers_request_publication_factory',
11 ]
12
13
14from zope.interface import implements
15from zope.publisher.interfaces.browser import (
16 IBrowserRequest, IDefaultBrowserLayer)
17
18from canonical.launchpad.webapp.publication import LaunchpadBrowserPublication
19from canonical.launchpad.webapp.servers import (
20 LaunchpadBrowserRequest, VHostWebServiceRequestPublicationFactory)
21
22
23class AnswersLayer(IBrowserRequest, IDefaultBrowserLayer):
24 """The Answers layer."""
25
26
27class AnswersBrowserRequest(LaunchpadBrowserRequest):
28 """Instances of AnswersBrowserRequest provide `AnswersLayer`."""
29 implements(AnswersLayer)
30
31 def __init__(self, body_instream, environ, response=None):
32 super(AnswersBrowserRequest, self).__init__(
33 body_instream, environ, response)
34 # Many of the responses from Answers vary based on language.
35 self.response.setHeader(
36 'Vary', 'Cookie, Authorization, Accept-Language')
37
38
39def answers_request_publication_factory():
40 return VHostWebServiceRequestPublicationFactory(
41 'answers', AnswersBrowserRequest, LaunchpadBrowserPublication)
042
=== added file 'lib/lp/answers/tests/test_publisher.py'
--- lib/lp/answers/tests/test_publisher.py 1970-01-01 00:00:00 +0000
+++ lib/lp/answers/tests/test_publisher.py 2010-07-22 20:59:01 +0000
@@ -0,0 +1,49 @@
1# Copyright 2010 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).
3
4"""Tests for answers's custom publications."""
5
6__metaclass__ = type
7
8import StringIO
9
10from canonical.config import config
11from canonical.launchpad.layers import WebServiceLayer
12from canonical.testing.layers import FunctionalLayer
13
14from lp.testing import TestCase
15from lp.testing.publication import get_request_and_publication
16
17from lp.answers.publisher import AnswersLayer, AnswersBrowserRequest
18
19
20class TestRegistration(TestCase):
21 """Answers' publication customizations are installed correctly."""
22
23 layer = FunctionalLayer
24
25 def test_answers_request_provides_answers_layer(self):
26 # The request constructed for requests to the answers hostname
27 # provides AnswersLayer.
28 request, publication = get_request_and_publication(
29 host=config.vhost.answers.hostname)
30 self.assertProvides(request, AnswersLayer)
31
32 def test_answers_host_has_api(self):
33 # Requests to /api on the answers domain are treated as web service
34 # requests.
35 request, publication = get_request_and_publication(
36 host=config.vhost.answers.hostname,
37 extra_environment={'PATH_INFO': '/api/1.0'})
38 # XXX MichaelHudson, 2010-07-20, bug=607664: WebServiceLayer only
39 # actually provides WebServiceLayer in the sense of verifyObject after
40 # traversal has started.
41 self.assertTrue(WebServiceLayer.providedBy(request))
42
43 def test_response_should_vary_based_on_language(self):
44 # Responses to requests to answers pages have the 'Vary' header set to
45 # include Accept-Language.
46 request = AnswersBrowserRequest(StringIO.StringIO(''), {})
47 self.assertEquals(
48 request.response.getHeader('Vary'),
49 'Cookie, Authorization, Accept-Language')
050
=== modified file 'lib/lp/app/tests/test_help.py'
--- lib/lp/app/tests/test_help.py 2010-07-22 01:48:51 +0000
+++ lib/lp/app/tests/test_help.py 2010-07-22 20:59:01 +0000
@@ -8,17 +8,19 @@
88
9from zope.component import getUtility9from zope.component import getUtility
1010
11
12from canonical.testing.layers import FunctionalLayer
13from canonical.launchpad.layers import (
14 AnswersLayer, BlueprintsLayer, BugsLayer, LaunchpadLayer,
15 TranslationsLayer)
16from canonical.launchpad.testing.systemdocs import create_view11from canonical.launchpad.testing.systemdocs import create_view
17from canonical.launchpad.webapp.interfaces import ILaunchpadApplication12from canonical.launchpad.webapp.interfaces import ILaunchpadApplication
13from canonical.launchpad.layers import LaunchpadLayer
14from canonical.testing.layers import FunctionalLayer
1815
19from canonical.lazr.folder import ExportedFolder16from canonical.lazr.folder import ExportedFolder
2017
18from lp.answers.publisher import AnswersLayer
19from lp.blueprints.publisher import BlueprintsLayer
20from lp.bugs.publisher import BugsLayer
21from lp.code.publisher import CodeLayer21from lp.code.publisher import CodeLayer
22from lp.translations.publisher import TranslationsLayer
23
2224
23# The root of the tree25# The root of the tree
24ROOT = os.path.realpath(26ROOT = os.path.realpath(
2527
=== modified file 'lib/lp/blueprints/browser/configure.zcml'
--- lib/lp/blueprints/browser/configure.zcml 2010-02-17 11:19:42 +0000
+++ lib/lp/blueprints/browser/configure.zcml 2010-07-22 20:59:01 +0000
@@ -18,7 +18,7 @@
18 <browser:defaultView18 <browser:defaultView
19 for="lp.blueprints.interfaces.sprint.ISprint"19 for="lp.blueprints.interfaces.sprint.ISprint"
20 name="+specs"20 name="+specs"
21 layer="canonical.launchpad.layers.BlueprintLayer"/>21 layer="lp.blueprints.publisher.BlueprintsLayer"/>
22 <browser:url22 <browser:url
23 for="lp.blueprints.interfaces.sprint.ISprint"23 for="lp.blueprints.interfaces.sprint.ISprint"
24 path_expression="name"24 path_expression="name"
@@ -562,7 +562,7 @@
562 <browser:defaultView562 <browser:defaultView
563 for="lp.registry.interfaces.distroseries.IDistroSeries"563 for="lp.registry.interfaces.distroseries.IDistroSeries"
564 name="+specs"564 name="+specs"
565 layer="canonical.launchpad.layers.BlueprintLayer"/>565 layer="lp.blueprints.publisher.BlueprintsLayer"/>
566 <browser:page566 <browser:page
567 name="+addspec"567 name="+addspec"
568 for="lp.registry.interfaces.distroseries.IDistroSeries"568 for="lp.registry.interfaces.distroseries.IDistroSeries"
569569
=== modified file 'lib/lp/blueprints/browser/tests/test_specificationtarget.py'
--- lib/lp/blueprints/browser/tests/test_specificationtarget.py 2009-11-08 19:34:52 +0000
+++ lib/lp/blueprints/browser/tests/test_specificationtarget.py 2010-07-22 20:59:01 +0000
@@ -5,11 +5,11 @@
55
6import unittest6import unittest
77
8from canonical.launchpad.layers import BlueprintLayer
9from canonical.testing.layers import DatabaseFunctionalLayer8from canonical.testing.layers import DatabaseFunctionalLayer
109
11from lp.blueprints.interfaces.specificationtarget import (10from lp.blueprints.interfaces.specificationtarget import (
12 IHasSpecifications, ISpecificationTarget)11 IHasSpecifications, ISpecificationTarget)
12from lp.blueprints.publisher import BlueprintsLayer
13from lp.testing import login_person, TestCaseWithFactory13from lp.testing import login_person, TestCaseWithFactory
14from lp.testing.views import create_view14from lp.testing.views import create_view
1515
@@ -58,7 +58,7 @@
58 def verify_involvment(self, context):58 def verify_involvment(self, context):
59 self.assertTrue(IHasSpecifications.providedBy(context))59 self.assertTrue(IHasSpecifications.providedBy(context))
60 view = create_view(60 view = create_view(
61 context, '+specs', layer=BlueprintLayer, principal=self.user)61 context, '+specs', layer=BlueprintsLayer, principal=self.user)
62 self.assertTrue(62 self.assertTrue(
63 '<div id="involvement" class="portlet involvement">' in view())63 '<div id="involvement" class="portlet involvement">' in view())
6464
@@ -78,7 +78,7 @@
78 context = self.factory.makePerson(name='pistachio')78 context = self.factory.makePerson(name='pistachio')
79 self.assertTrue(IHasSpecifications.providedBy(context))79 self.assertTrue(IHasSpecifications.providedBy(context))
80 view = create_view(80 view = create_view(
81 context, '+specs', layer=BlueprintLayer, principal=self.user)81 context, '+specs', layer=BlueprintsLayer, principal=self.user)
82 self.assertFalse(82 self.assertFalse(
83 '<div id="involvement" class="portlet involvement">' in view())83 '<div id="involvement" class="portlet involvement">' in view())
8484
8585
=== modified file 'lib/lp/blueprints/configure.zcml'
--- lib/lp/blueprints/configure.zcml 2009-09-23 03:36:55 +0000
+++ lib/lp/blueprints/configure.zcml 2010-07-22 20:59:01 +0000
@@ -12,8 +12,12 @@
12 <include12 <include
13 package=".browser"/>13 package=".browser"/>
1414
15 <publisher
16 name="blueprints"
17 factory="lp.blueprints.publisher.blueprints_request_publication_factory"/>
18
15 <lp:help-folder19 <lp:help-folder
16 folder="help" type="canonical.launchpad.layers.BlueprintsLayer" />20 folder="help" type="lp.blueprints.publisher.BlueprintsLayer" />
1721
18 <!-- Sprint -->22 <!-- Sprint -->
1923
2024
=== added file 'lib/lp/blueprints/publisher.py'
--- lib/lp/blueprints/publisher.py 1970-01-01 00:00:00 +0000
+++ lib/lp/blueprints/publisher.py 2010-07-22 20:59:01 +0000
@@ -0,0 +1,34 @@
1# Copyright 2010 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).
3
4"""Blueprints' custom publication."""
5
6__metaclass__ = type
7__all__ = [
8 'BlueprintsBrowserRequest',
9 'BlueprintsLayer',
10 'blueprints_request_publication_factory',
11 ]
12
13
14from zope.interface import implements
15from zope.publisher.interfaces.browser import (
16 IBrowserRequest, IDefaultBrowserLayer)
17
18from canonical.launchpad.webapp.publication import LaunchpadBrowserPublication
19from canonical.launchpad.webapp.servers import (
20 LaunchpadBrowserRequest, VHostWebServiceRequestPublicationFactory)
21
22
23class BlueprintsLayer(IBrowserRequest, IDefaultBrowserLayer):
24 """The Blueprints layer."""
25
26
27class BlueprintsBrowserRequest(LaunchpadBrowserRequest):
28 """Instances of BlueprintsBrowserRequest provide `BlueprintsLayer`."""
29 implements(BlueprintsLayer)
30
31
32def blueprints_request_publication_factory():
33 return VHostWebServiceRequestPublicationFactory(
34 'blueprints', BlueprintsBrowserRequest, LaunchpadBrowserPublication)
035
=== added file 'lib/lp/blueprints/tests/test_publisher.py'
--- lib/lp/blueprints/tests/test_publisher.py 1970-01-01 00:00:00 +0000
+++ lib/lp/blueprints/tests/test_publisher.py 2010-07-22 20:59:01 +0000
@@ -0,0 +1,39 @@
1# Copyright 2010 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).
3
4"""Tests for blueprints' custom publications."""
5
6__metaclass__ = type
7
8from canonical.config import config
9from canonical.launchpad.layers import WebServiceLayer
10from canonical.testing.layers import FunctionalLayer
11
12from lp.testing import TestCase
13from lp.testing.publication import get_request_and_publication
14
15from lp.blueprints.publisher import BlueprintsLayer
16
17
18class TestRegistration(TestCase):
19 """Blueprints's publication customizations are installed correctly."""
20
21 layer = FunctionalLayer
22
23 def test_blueprints_request_provides_blueprints_layer(self):
24 # The request constructed for requests to the blueprints hostname
25 # provides BlueprintsLayer.
26 request, publication = get_request_and_publication(
27 host=config.vhost.blueprints.hostname)
28 self.assertProvides(request, BlueprintsLayer)
29
30 def test_blueprints_host_has_api(self):
31 # Requests to /api on the blueprints domain are treated as web service
32 # requests.
33 request, publication = get_request_and_publication(
34 host=config.vhost.blueprints.hostname,
35 extra_environment={'PATH_INFO': '/api/1.0'})
36 # XXX MichaelHudson, 2010-07-20, bug=607664: WebServiceLayer only
37 # actually provides WebServiceLayer in the sense of verifyObject after
38 # traversal has started.
39 self.assertTrue(WebServiceLayer.providedBy(request))
040
=== modified file 'lib/lp/bugs/browser/malone.py'
--- lib/lp/bugs/browser/malone.py 2009-09-04 15:32:52 +0000
+++ lib/lp/bugs/browser/malone.py 2010-07-22 20:59:01 +0000
@@ -13,7 +13,6 @@
13from zope.component import getUtility13from zope.component import getUtility
14from zope.security.interfaces import Unauthorized14from zope.security.interfaces import Unauthorized
1515
16import canonical.launchpad.layers
1716
18from canonical.launchpad.webapp import (17from canonical.launchpad.webapp import (
19 Link, Navigation, canonical_url, stepto)18 Link, Navigation, canonical_url, stepto)
@@ -25,6 +24,7 @@
25from lp.bugs.interfaces.bugtracker import IBugTrackerSet24from lp.bugs.interfaces.bugtracker import IBugTrackerSet
26from lp.bugs.interfaces.cve import ICveSet25from lp.bugs.interfaces.cve import ICveSet
27from lp.bugs.interfaces.malone import IMaloneApplication26from lp.bugs.interfaces.malone import IMaloneApplication
27from lp.bugs.publisher import BugsLayer
28from lp.registry.interfaces.distribution import IDistributionSet28from lp.registry.interfaces.distribution import IDistributionSet
29from lp.registry.interfaces.product import IProductSet29from lp.registry.interfaces.product import IProductSet
3030
@@ -33,7 +33,7 @@
3333
34 usedfor = IMaloneApplication34 usedfor = IMaloneApplication
3535
36 newlayer = canonical.launchpad.layers.BugsLayer36 newlayer = BugsLayer
3737
38 @stepto('bugs')38 @stepto('bugs')
39 def bugs(self):39 def bugs(self):
4040
=== modified file 'lib/lp/bugs/browser/tests/test_configure_bugtracker_links.py'
--- lib/lp/bugs/browser/tests/test_configure_bugtracker_links.py 2010-06-17 15:26:05 +0000
+++ lib/lp/bugs/browser/tests/test_configure_bugtracker_links.py 2010-07-22 20:59:01 +0000
@@ -8,9 +8,10 @@
8import unittest8import unittest
99
10from canonical.launchpad.ftests import ANONYMOUS, login10from canonical.launchpad.ftests import ANONYMOUS, login
11from canonical.launchpad.layers import BugsLayer
12from canonical.testing import LaunchpadFunctionalLayer11from canonical.testing import LaunchpadFunctionalLayer
1312
13from lp.bugs.publisher import BugsLayer
14
14from lp.testing import login_person, TestCaseWithFactory15from lp.testing import login_person, TestCaseWithFactory
15from lp.testing.views import create_initialized_view16from lp.testing.views import create_initialized_view
1617
1718
=== modified file 'lib/lp/bugs/configure.zcml'
--- lib/lp/bugs/configure.zcml 2010-07-22 20:30:26 +0000
+++ lib/lp/bugs/configure.zcml 2010-07-22 20:59:01 +0000
@@ -12,8 +12,12 @@
12 <include12 <include
13 package=".browser"/>13 package=".browser"/>
1414
15 <publisher
16 name="bugs"
17 factory="lp.bugs.publisher.bugs_request_publication_factory"/>
18
15 <lp:help-folder19 <lp:help-folder
16 folder="help" type="canonical.launchpad.layers.BugsLayer" />20 folder="help" type="lp.bugs.publisher.BugsLayer" />
1721
18 <class22 <class
19 class="canonical.launchpad.database.BugActivity">23 class="canonical.launchpad.database.BugActivity">
2024
=== added file 'lib/lp/bugs/publisher.py'
--- lib/lp/bugs/publisher.py 1970-01-01 00:00:00 +0000
+++ lib/lp/bugs/publisher.py 2010-07-22 20:59:01 +0000
@@ -0,0 +1,34 @@
1# Copyright 2010 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).
3
4"""Bugs' custom publication."""
5
6__metaclass__ = type
7__all__ = [
8 'BugsBrowserRequest',
9 'BugsLayer',
10 'bugs_request_publication_factory',
11 ]
12
13
14from zope.interface import implements
15from zope.publisher.interfaces.browser import (
16 IBrowserRequest, IDefaultBrowserLayer)
17
18from canonical.launchpad.webapp.publication import LaunchpadBrowserPublication
19from canonical.launchpad.webapp.servers import (
20 LaunchpadBrowserRequest, VHostWebServiceRequestPublicationFactory)
21
22
23class BugsLayer(IBrowserRequest, IDefaultBrowserLayer):
24 """The Bugs layer."""
25
26
27class BugsBrowserRequest(LaunchpadBrowserRequest):
28 """Instances of BugBrowserRequest provide `BugsLayer`."""
29 implements(BugsLayer)
30
31
32def bugs_request_publication_factory():
33 return VHostWebServiceRequestPublicationFactory(
34 'bugs', BugsBrowserRequest, LaunchpadBrowserPublication)
035
=== added file 'lib/lp/bugs/tests/test_publisher.py'
--- lib/lp/bugs/tests/test_publisher.py 1970-01-01 00:00:00 +0000
+++ lib/lp/bugs/tests/test_publisher.py 2010-07-22 20:59:01 +0000
@@ -0,0 +1,39 @@
1# Copyright 2010 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).
3
4"""Tests for bugs' custom publications."""
5
6__metaclass__ = type
7
8from canonical.config import config
9from canonical.launchpad.layers import WebServiceLayer
10from canonical.testing.layers import FunctionalLayer
11
12from lp.testing import TestCase
13from lp.testing.publication import get_request_and_publication
14
15from lp.bugs.publisher import BugsLayer
16
17
18class TestRegistration(TestCase):
19 """Bugs publication customizations are installed correctly."""
20
21 layer = FunctionalLayer
22
23 def test_bugs_request_provides_bugs_layer(self):
24 # The request constructed for requests to the bugs hostname provides
25 # BugsLayer.
26 request, publication = get_request_and_publication(
27 host=config.vhost.bugs.hostname)
28 self.assertProvides(request, BugsLayer)
29
30 def test_bugs_host_has_api(self):
31 # Requests to /api on the bugs domain are treated as web service
32 # requests.
33 request, publication = get_request_and_publication(
34 host=config.vhost.bugs.hostname,
35 extra_environment={'PATH_INFO': '/api/1.0'})
36 # XXX MichaelHudson, 2010-07-20, bug=607664: WebServiceLayer only
37 # actually provides WebServiceLayer in the sense of verifyObject after
38 # traversal has started.
39 self.assertTrue(WebServiceLayer.providedBy(request))
040
=== modified file 'lib/lp/code/tests/test_publisher.py'
--- lib/lp/code/tests/test_publisher.py 2010-07-20 23:53:33 +0000
+++ lib/lp/code/tests/test_publisher.py 2010-07-22 20:59:01 +0000
@@ -5,8 +5,6 @@
55
6__metaclass__ = type6__metaclass__ = type
77
8import unittest
9
10from canonical.config import config8from canonical.config import config
11from canonical.launchpad.layers import WebServiceLayer9from canonical.launchpad.layers import WebServiceLayer
12from canonical.testing.layers import FunctionalLayer10from canonical.testing.layers import FunctionalLayer
@@ -39,7 +37,3 @@
39 # actually provides WebServiceLayer in the sense of verifyObject after37 # actually provides WebServiceLayer in the sense of verifyObject after
40 # traversal has started.38 # traversal has started.
41 self.assertTrue(WebServiceLayer.providedBy(request))39 self.assertTrue(WebServiceLayer.providedBy(request))
42
43
44def test_suite():
45 return unittest.TestLoader().loadTestsFromName(__name__)
4640
=== modified file 'lib/lp/registry/browser/configure.zcml'
--- lib/lp/registry/browser/configure.zcml 2010-07-16 15:40:14 +0000
+++ lib/lp/registry/browser/configure.zcml 2010-07-22 20:59:01 +0000
@@ -57,7 +57,7 @@
57 name="+index"/>57 name="+index"/>
58 <browser:defaultView58 <browser:defaultView
59 for="lp.registry.interfaces.distroseries.IDistroSeries"59 for="lp.registry.interfaces.distroseries.IDistroSeries"
60 layer="canonical.launchpad.layers.BugsLayer"60 layer="lp.bugs.publisher.BugsLayer"
61 name="+bugs-index"/>61 name="+bugs-index"/>
62 <browser:page62 <browser:page
63 for="lp.registry.interfaces.distroseries.IDistroSeries"63 for="lp.registry.interfaces.distroseries.IDistroSeries"
@@ -294,15 +294,15 @@
294 <browser:defaultView294 <browser:defaultView
295 for="lp.registry.interfaces.projectgroup.IProjectGroup"295 for="lp.registry.interfaces.projectgroup.IProjectGroup"
296 name="+bugs"296 name="+bugs"
297 layer="canonical.launchpad.layers.BugsLayer"/>297 layer="lp.bugs.publisher.BugsLayer"/>
298 <browser:defaultView298 <browser:defaultView
299 for="lp.registry.interfaces.projectgroup.IProjectGroup"299 for="lp.registry.interfaces.projectgroup.IProjectGroup"
300 name="+specs"300 name="+specs"
301 layer="canonical.launchpad.layers.BlueprintLayer"/>301 layer="lp.blueprints.publisher.BlueprintsLayer"/>
302 <browser:defaultView302 <browser:defaultView
303 for="lp.registry.interfaces.projectgroup.IProjectGroup"303 for="lp.registry.interfaces.projectgroup.IProjectGroup"
304 name="+questions"304 name="+questions"
305 layer="canonical.launchpad.layers.AnswersLayer"/>305 layer="lp.answers.publisher.AnswersLayer"/>
306 <browser:pages306 <browser:pages
307 for="lp.registry.interfaces.projectgroup.IProjectGroup"307 for="lp.registry.interfaces.projectgroup.IProjectGroup"
308 class="lp.registry.browser.project.ProjectView"308 class="lp.registry.browser.project.ProjectView"
@@ -408,7 +408,7 @@
408 <browser:defaultView408 <browser:defaultView
409 for="lp.registry.interfaces.projectgroup.IProjectGroupSeries"409 for="lp.registry.interfaces.projectgroup.IProjectGroupSeries"
410 name="+specs"410 name="+specs"
411 layer="canonical.launchpad.layers.BlueprintLayer"/>411 layer="lp.blueprints.publisher.BlueprintsLayer"/>
412 <browser:menus412 <browser:menus
413 classes="413 classes="
414 ProjectActionMenu414 ProjectActionMenu
@@ -428,11 +428,11 @@
428 name="+index"/>428 name="+index"/>
429 <browser:defaultView429 <browser:defaultView
430 for="lp.registry.interfaces.distributionsourcepackage.IDistributionSourcePackage"430 for="lp.registry.interfaces.distributionsourcepackage.IDistributionSourcePackage"
431 layer="canonical.launchpad.layers.AnswersLayer"431 layer="lp.answers.publisher.AnswersLayer"
432 name="+questions"/>432 name="+questions"/>
433 <browser:defaultView433 <browser:defaultView
434 for="lp.registry.interfaces.distributionsourcepackage.IDistributionSourcePackage"434 for="lp.registry.interfaces.distributionsourcepackage.IDistributionSourcePackage"
435 layer="canonical.launchpad.layers.BugsLayer"435 layer="lp.bugs.publisher.BugsLayer"
436 name="+bugs"/>436 name="+bugs"/>
437 <browser:url437 <browser:url
438 for="lp.registry.interfaces.distributionsourcepackage.IDistributionSourcePackage"438 for="lp.registry.interfaces.distributionsourcepackage.IDistributionSourcePackage"
@@ -762,11 +762,11 @@
762 name="+index"/>762 name="+index"/>
763 <browser:defaultView763 <browser:defaultView
764 for="lp.registry.interfaces.person.IPerson"764 for="lp.registry.interfaces.person.IPerson"
765 layer="canonical.launchpad.layers.BlueprintLayer"765 layer="lp.blueprints.publisher.BlueprintsLayer"
766 name="+specs"/>766 name="+specs"/>
767 <browser:defaultView767 <browser:defaultView
768 for="lp.registry.interfaces.person.IPerson"768 for="lp.registry.interfaces.person.IPerson"
769 layer="canonical.launchpad.layers.BugsLayer"769 layer="lp.bugs.publisher.BugsLayer"
770 name="+bugs"/>770 name="+bugs"/>
771 <adapter771 <adapter
772 factory="lp.registry.browser.person.PersonXHTMLRepresentation"772 factory="lp.registry.browser.person.PersonXHTMLRepresentation"
@@ -1353,18 +1353,18 @@
1353 <browser:defaultView1353 <browser:defaultView
1354 for="lp.registry.interfaces.product.IProduct"1354 for="lp.registry.interfaces.product.IProduct"
1355 name="+specs"1355 name="+specs"
1356 layer="canonical.launchpad.layers.BlueprintLayer"/>1356 layer="lp.blueprints.publisher.BlueprintsLayer"/>
1357 <browser:defaultView1357 <browser:defaultView
1358 for="lp.registry.interfaces.product.IProduct"1358 for="lp.registry.interfaces.product.IProduct"
1359 name="+code-index"1359 name="+code-index"
1360 layer="lp.code.publisher.CodeLayer"/>1360 layer="lp.code.publisher.CodeLayer"/>
1361 <browser:defaultView1361 <browser:defaultView
1362 for="lp.registry.interfaces.product.IProduct"1362 for="lp.registry.interfaces.product.IProduct"
1363 layer="canonical.launchpad.layers.AnswersLayer"1363 layer="lp.answers.publisher.AnswersLayer"
1364 name="+questions"/>1364 name="+questions"/>
1365 <browser:defaultView1365 <browser:defaultView
1366 for="lp.registry.interfaces.product.IProduct"1366 for="lp.registry.interfaces.product.IProduct"
1367 layer="canonical.launchpad.layers.BugsLayer"1367 layer="lp.bugs.publisher.BugsLayer"
1368 name="+bugs-index"/>1368 name="+bugs-index"/>
1369 <browser:navigation1369 <browser:navigation
1370 module="lp.registry.browser.product"1370 module="lp.registry.browser.product"
@@ -1596,10 +1596,10 @@
1596 <browser:defaultView1596 <browser:defaultView
1597 for="lp.registry.interfaces.productseries.IProductSeries"1597 for="lp.registry.interfaces.productseries.IProductSeries"
1598 name="+specs"1598 name="+specs"
1599 layer="canonical.launchpad.layers.BlueprintLayer"/>1599 layer="lp.blueprints.publisher.BlueprintsLayer"/>
1600 <browser:defaultView1600 <browser:defaultView
1601 for="lp.registry.interfaces.productseries.IProductSeries"1601 for="lp.registry.interfaces.productseries.IProductSeries"
1602 layer="canonical.launchpad.layers.BugsLayer"1602 layer="lp.bugs.publisher.BugsLayer"
1603 name="+bugs-index"/>1603 name="+bugs-index"/>
1604 <browser:page1604 <browser:page
1605 name="+get-involved"1605 name="+get-involved"
@@ -1739,14 +1739,14 @@
1739 <browser:defaultView1739 <browser:defaultView
1740 for="lp.registry.interfaces.distribution.IDistribution"1740 for="lp.registry.interfaces.distribution.IDistribution"
1741 name="+specs"1741 name="+specs"
1742 layer="canonical.launchpad.layers.BlueprintLayer"/>1742 layer="lp.blueprints.publisher.BlueprintsLayer"/>
1743 <browser:defaultView1743 <browser:defaultView
1744 for="lp.registry.interfaces.distribution.IDistribution"1744 for="lp.registry.interfaces.distribution.IDistribution"
1745 layer="canonical.launchpad.layers.BugsLayer"1745 layer="lp.bugs.publisher.BugsLayer"
1746 name="+bugs-index"/>1746 name="+bugs-index"/>
1747 <browser:defaultView1747 <browser:defaultView
1748 for="lp.registry.interfaces.distribution.IDistribution"1748 for="lp.registry.interfaces.distribution.IDistribution"
1749 layer="canonical.launchpad.layers.AnswersLayer"1749 layer="lp.answers.publisher.AnswersLayer"
1750 name="+questions"/>1750 name="+questions"/>
1751 <browser:navigation1751 <browser:navigation
1752 module="lp.registry.browser.distribution"1752 module="lp.registry.browser.distribution"
@@ -1946,11 +1946,11 @@
1946 name="+index"/>1946 name="+index"/>
1947 <browser:defaultView1947 <browser:defaultView
1948 for="lp.registry.interfaces.sourcepackage.ISourcePackage"1948 for="lp.registry.interfaces.sourcepackage.ISourcePackage"
1949 layer="canonical.launchpad.layers.BugsLayer"1949 layer="lp.bugs.publisher.BugsLayer"
1950 name="+bugs"/>1950 name="+bugs"/>
1951 <browser:defaultView1951 <browser:defaultView
1952 for="lp.registry.interfaces.sourcepackage.ISourcePackage"1952 for="lp.registry.interfaces.sourcepackage.ISourcePackage"
1953 layer="canonical.launchpad.layers.AnswersLayer"1953 layer="lp.answers.publisher.AnswersLayer"
1954 name="+questions"/>1954 name="+questions"/>
1955 <browser:navigation1955 <browser:navigation
1956 module="lp.registry.browser.sourcepackage"1956 module="lp.registry.browser.sourcepackage"
19571957
=== modified file 'lib/lp/translations/browser/configure.zcml'
--- lib/lp/translations/browser/configure.zcml 2010-04-19 08:11:52 +0000
+++ lib/lp/translations/browser/configure.zcml 2010-07-22 20:59:01 +0000
@@ -15,7 +15,7 @@
15 <browser:defaultView15 <browser:defaultView
16 for="canonical.launchpad.interfaces.IRosettaApplication"16 for="canonical.launchpad.interfaces.IRosettaApplication"
17 name="+index"17 name="+index"
18 layer="canonical.launchpad.layers.TranslationsLayer"/>18 layer="lp.translations.publisher.TranslationsLayer"/>
19 <browser:navigation19 <browser:navigation
20 module="lp.translations.browser.translations"20 module="lp.translations.browser.translations"
21 classes="21 classes="
@@ -25,7 +25,7 @@
25 facet="translations"25 facet="translations"
26 permission="zope.Public"26 permission="zope.Public"
27 class="lp.translations.browser.translations.RosettaApplicationView"27 class="lp.translations.browser.translations.RosettaApplicationView"
28 layer="canonical.launchpad.layers.TranslationsLayer">28 layer="lp.translations.publisher.TranslationsLayer">
29 <browser:page29 <browser:page
30 name="+index"30 name="+index"
31 template="../templates/rosetta-index.pt"/>31 template="../templates/rosetta-index.pt"/>
@@ -44,7 +44,7 @@
44 facet="translations"44 facet="translations"
45 permission="zope.Public"45 permission="zope.Public"
46 class="lp.translations.browser.translations.TranslatableProductsView"46 class="lp.translations.browser.translations.TranslatableProductsView"
47 layer="canonical.launchpad.layers.TranslationsLayer"47 layer="lp.translations.publisher.TranslationsLayer"
48 name="+products-with-translations"48 name="+products-with-translations"
49 template="../templates/rosetta-products.pt"/>49 template="../templates/rosetta-products.pt"/>
50 <browser:pages50 <browser:pages
@@ -66,48 +66,48 @@
66 permission="zope.Public"66 permission="zope.Public"
67 name="+barchart"67 name="+barchart"
68 template="../templates/rosettastats-barchart.pt"68 template="../templates/rosettastats-barchart.pt"
69 layer="canonical.launchpad.layers.TranslationsLayer"/>69 layer="lp.translations.publisher.TranslationsLayer"/>
70 <browser:page70 <browser:page
71 for="*"71 for="*"
72 name="+translations-macros"72 name="+translations-macros"
73 facet="translations"73 facet="translations"
74 permission="zope.Public"74 permission="zope.Public"
75 template="../templates/translations-macros.pt"75 template="../templates/translations-macros.pt"
76 layer="canonical.launchpad.layers.TranslationsLayer"/>76 layer="lp.translations.publisher.TranslationsLayer"/>
77 <browser:page77 <browser:page
78 for="lp.translations.interfaces.translationgroup.ITranslationPolicy"78 for="lp.translations.interfaces.translationgroup.ITranslationPolicy"
79 facet="translations"79 facet="translations"
80 permission="zope.Public"80 permission="zope.Public"
81 name="+portlet-translation-groups-and-permission"81 name="+portlet-translation-groups-and-permission"
82 template="../templates/hastranslationgroup-portlet-translation-groups-and-permission.pt"82 template="../templates/hastranslationgroup-portlet-translation-groups-and-permission.pt"
83 layer="canonical.launchpad.layers.TranslationsLayer"/>83 layer="lp.translations.publisher.TranslationsLayer"/>
84 <facet84 <facet
85 facet="translations">85 facet="translations">
86 <browser:defaultView86 <browser:defaultView
87 for="lp.translations.interfaces.translator.ITranslator"87 for="lp.translations.interfaces.translator.ITranslator"
88 name="+admin"88 name="+admin"
89 layer="canonical.launchpad.layers.TranslationsLayer"/>89 layer="lp.translations.publisher.TranslationsLayer"/>
90 <browser:page90 <browser:page
91 name="+admin"91 name="+admin"
92 for="lp.translations.interfaces.translator.ITranslator"92 for="lp.translations.interfaces.translator.ITranslator"
93 permission="launchpad.Admin"93 permission="launchpad.Admin"
94 class="lp.translations.browser.translator.TranslatorAdminView"94 class="lp.translations.browser.translator.TranslatorAdminView"
95 template="../../app/templates/generic-edit.pt"95 template="../../app/templates/generic-edit.pt"
96 layer="canonical.launchpad.layers.TranslationsLayer"/>96 layer="lp.translations.publisher.TranslationsLayer"/>
97 <browser:page97 <browser:page
98 name="+edit"98 name="+edit"
99 for="lp.translations.interfaces.translator.IEditTranslator"99 for="lp.translations.interfaces.translator.IEditTranslator"
100 permission="launchpad.Edit"100 permission="launchpad.Edit"
101 class="lp.translations.browser.translator.TranslatorEditView"101 class="lp.translations.browser.translator.TranslatorEditView"
102 template="../../app/templates/generic-edit.pt"102 template="../../app/templates/generic-edit.pt"
103 layer="canonical.launchpad.layers.TranslationsLayer"/>103 layer="lp.translations.publisher.TranslationsLayer"/>
104 <browser:page104 <browser:page
105 name="+remove"105 name="+remove"
106 for="lp.translations.interfaces.translator.ITranslator"106 for="lp.translations.interfaces.translator.ITranslator"
107 permission="launchpad.Edit"107 permission="launchpad.Edit"
108 class="lp.translations.browser.translator.TranslatorRemoveView"108 class="lp.translations.browser.translator.TranslatorRemoveView"
109 template="../../app/templates/generic-edit.pt"109 template="../../app/templates/generic-edit.pt"
110 layer="canonical.launchpad.layers.TranslationsLayer"/>110 layer="lp.translations.publisher.TranslationsLayer"/>
111 </facet>111 </facet>
112 <facet112 <facet
113 facet="translations">113 facet="translations">
@@ -119,7 +119,7 @@
119 <browser:defaultView119 <browser:defaultView
120 for="lp.translations.interfaces.translationimportqueue.ITranslationImportQueueEntry"120 for="lp.translations.interfaces.translationimportqueue.ITranslationImportQueueEntry"
121 name="+index"121 name="+index"
122 layer="canonical.launchpad.layers.TranslationsLayer"/>122 layer="lp.translations.publisher.TranslationsLayer"/>
123 <browser:url123 <browser:url
124 for="lp.translations.interfaces.translationimportqueue.ITranslationImportQueueEntry"124 for="lp.translations.interfaces.translationimportqueue.ITranslationImportQueueEntry"
125 path_expression="string:${id}"125 path_expression="string:${id}"
@@ -130,12 +130,12 @@
130 class="lp.translations.browser.translationimportqueue.TranslationImportQueueEntryView"130 class="lp.translations.browser.translationimportqueue.TranslationImportQueueEntryView"
131 permission="launchpad.Admin"131 permission="launchpad.Admin"
132 template="../templates/translationimportqueueentry-index.pt"132 template="../templates/translationimportqueueentry-index.pt"
133 layer="canonical.launchpad.layers.TranslationsLayer"/>133 layer="lp.translations.publisher.TranslationsLayer"/>
134 <browser:page134 <browser:page
135 for="lp.translations.interfaces.translationimportqueue.ITranslationImportQueueEntry"135 for="lp.translations.interfaces.translationimportqueue.ITranslationImportQueueEntry"
136 facet="translations"136 facet="translations"
137 permission="zope.Public"137 permission="zope.Public"
138 layer="canonical.launchpad.layers.TranslationsLayer"138 layer="lp.translations.publisher.TranslationsLayer"
139 name="+portlet-details"139 name="+portlet-details"
140 class="lp.translations.browser.translationimportqueue.TranslationImportQueueEntryView"140 class="lp.translations.browser.translationimportqueue.TranslationImportQueueEntryView"
141 template="../templates/translationimportqueueentry-portlet-details.pt"/>141 template="../templates/translationimportqueueentry-portlet-details.pt"/>
@@ -146,7 +146,7 @@
146 <browser:defaultView146 <browser:defaultView
147 for="lp.translations.interfaces.translationimportqueue.ITranslationImportQueue"147 for="lp.translations.interfaces.translationimportqueue.ITranslationImportQueue"
148 name="+index"148 name="+index"
149 layer="canonical.launchpad.layers.TranslationsLayer"/>149 layer="lp.translations.publisher.TranslationsLayer"/>
150 <browser:page150 <browser:page
151 for="lp.translations.interfaces.translationimportqueue.ITranslationImportQueue"151 for="lp.translations.interfaces.translationimportqueue.ITranslationImportQueue"
152 name="+index"152 name="+index"
@@ -154,7 +154,7 @@
154 facet="translations"154 facet="translations"
155 permission="zope.Public"155 permission="zope.Public"
156 template="../templates/translationimportqueue-index.pt"156 template="../templates/translationimportqueue-index.pt"
157 layer="canonical.launchpad.layers.TranslationsLayer"/>157 layer="lp.translations.publisher.TranslationsLayer"/>
158 </facet>158 </facet>
159 <browser:url159 <browser:url
160 for="lp.translations.interfaces.distroserieslanguage.IDistroSeriesLanguage"160 for="lp.translations.interfaces.distroserieslanguage.IDistroSeriesLanguage"
@@ -167,12 +167,12 @@
167 <browser:defaultView167 <browser:defaultView
168 for="lp.translations.interfaces.distroserieslanguage.IDistroSeriesLanguage"168 for="lp.translations.interfaces.distroserieslanguage.IDistroSeriesLanguage"
169 name="+index"169 name="+index"
170 layer="canonical.launchpad.layers.TranslationsLayer"/>170 layer="lp.translations.publisher.TranslationsLayer"/>
171 <browser:pages171 <browser:pages
172 for="lp.translations.interfaces.distroserieslanguage.IDistroSeriesLanguage"172 for="lp.translations.interfaces.distroserieslanguage.IDistroSeriesLanguage"
173 permission="zope.Public"173 permission="zope.Public"
174 facet="translations"174 facet="translations"
175 layer="canonical.launchpad.layers.TranslationsLayer">175 layer="lp.translations.publisher.TranslationsLayer">
176 <browser:page176 <browser:page
177 name="+rosetta-status-legend"177 name="+rosetta-status-legend"
178 template="../templates/rosetta-status-legend.pt"/>178 template="../templates/rosetta-status-legend.pt"/>
@@ -184,7 +184,7 @@
184 template="../templates/serieslanguage-index.pt"184 template="../templates/serieslanguage-index.pt"
185 class="lp.translations.browser.serieslanguage.DistroSeriesLanguageView"185 class="lp.translations.browser.serieslanguage.DistroSeriesLanguageView"
186 facet="translations"186 facet="translations"
187 layer="canonical.launchpad.layers.TranslationsLayer"/>187 layer="lp.translations.publisher.TranslationsLayer"/>
188 <facet188 <facet
189 facet="translations">189 facet="translations">
190 <browser:navigation190 <browser:navigation
@@ -204,19 +204,19 @@
204 <browser:defaultView204 <browser:defaultView
205 for="lp.translations.interfaces.pofile.IPOFile"205 for="lp.translations.interfaces.pofile.IPOFile"
206 name="+translate"206 name="+translate"
207 layer="canonical.launchpad.layers.TranslationsLayer"/>207 layer="lp.translations.publisher.TranslationsLayer"/>
208 <browser:page208 <browser:page
209 for="lp.translations.interfaces.pofile.IPOFile"209 for="lp.translations.interfaces.pofile.IPOFile"
210 name="+details"210 name="+details"
211 permission="zope.Public"211 permission="zope.Public"
212 class="lp.translations.browser.pofile.POFileDetailsView"212 class="lp.translations.browser.pofile.POFileDetailsView"
213 layer="canonical.launchpad.layers.TranslationsLayer"213 layer="lp.translations.publisher.TranslationsLayer"
214 template="../templates/pofile-details.pt"/>214 template="../templates/pofile-details.pt"/>
215 <browser:pages215 <browser:pages
216 for="lp.translations.interfaces.pofile.IPOFile"216 for="lp.translations.interfaces.pofile.IPOFile"
217 permission="zope.Public"217 permission="zope.Public"
218 class="lp.translations.browser.pofile.POFileView"218 class="lp.translations.browser.pofile.POFileView"
219 layer="canonical.launchpad.layers.TranslationsLayer">219 layer="lp.translations.publisher.TranslationsLayer">
220 <!-- POFile Portlets -->220 <!-- POFile Portlets -->
221 <browser:page221 <browser:page
222 name="+contributors"222 name="+contributors"
@@ -237,7 +237,7 @@
237 class="lp.translations.browser.pofile.POFileUploadView"237 class="lp.translations.browser.pofile.POFileUploadView"
238 for="lp.translations.interfaces.pofile.IPOFile"238 for="lp.translations.interfaces.pofile.IPOFile"
239 template="../templates/pofile-upload.pt"239 template="../templates/pofile-upload.pt"
240 layer="canonical.launchpad.layers.TranslationsLayer"/>240 layer="lp.translations.publisher.TranslationsLayer"/>
241 <browser:page241 <browser:page
242 name="+translate"242 name="+translate"
243 for="lp.translations.interfaces.pofile.IPOFile"243 for="lp.translations.interfaces.pofile.IPOFile"
@@ -250,21 +250,21 @@
250 permission="zope.Public"250 permission="zope.Public"
251 template="../templates/pofile-translate.pt"251 template="../templates/pofile-translate.pt"
252 class="lp.translations.browser.pofile.POFileTranslateView"252 class="lp.translations.browser.pofile.POFileTranslateView"
253 layer="canonical.launchpad.layers.TranslationsLayer"/>253 layer="lp.translations.publisher.TranslationsLayer"/>
254 <browser:page254 <browser:page
255 name="+export"255 name="+export"
256 for="lp.translations.interfaces.pofile.IPOFile"256 for="lp.translations.interfaces.pofile.IPOFile"
257 permission="launchpad.AnyPerson"257 permission="launchpad.AnyPerson"
258 template="../templates/pofile-export.pt"258 template="../templates/pofile-export.pt"
259 class="lp.translations.browser.pofile.POExportView"259 class="lp.translations.browser.pofile.POExportView"
260 layer="canonical.launchpad.layers.TranslationsLayer"/>260 layer="lp.translations.publisher.TranslationsLayer"/>
261 <browser:page261 <browser:page
262 name="+filter"262 name="+filter"
263 for="lp.translations.interfaces.pofile.IPOFile"263 for="lp.translations.interfaces.pofile.IPOFile"
264 permission="zope.Public"264 permission="zope.Public"
265 template="../templates/pofile-filter.pt"265 template="../templates/pofile-filter.pt"
266 class="lp.translations.browser.pofile.POFileFilteredView"266 class="lp.translations.browser.pofile.POFileFilteredView"
267 layer="canonical.launchpad.layers.TranslationsLayer"/>267 layer="lp.translations.publisher.TranslationsLayer"/>
268 </facet>268 </facet>
269 <browser:url269 <browser:url
270 for="lp.translations.interfaces.productserieslanguage.IProductSeriesLanguage"270 for="lp.translations.interfaces.productserieslanguage.IProductSeriesLanguage"
@@ -282,7 +282,7 @@
282 for="lp.translations.interfaces.productserieslanguage.IProductSeriesLanguage"282 for="lp.translations.interfaces.productserieslanguage.IProductSeriesLanguage"
283 permission="zope.Public"283 permission="zope.Public"
284 facet="translations"284 facet="translations"
285 layer="canonical.launchpad.layers.TranslationsLayer">285 layer="lp.translations.publisher.TranslationsLayer">
286 <browser:page286 <browser:page
287 name="+rosetta-status-legend"287 name="+rosetta-status-legend"
288 template="../templates/rosetta-status-legend.pt"/>288 template="../templates/rosetta-status-legend.pt"/>
@@ -294,7 +294,7 @@
294 template="../templates/serieslanguage-index.pt"294 template="../templates/serieslanguage-index.pt"
295 class="lp.translations.browser.serieslanguage.ProductSeriesLanguageView"295 class="lp.translations.browser.serieslanguage.ProductSeriesLanguageView"
296 facet="translations"296 facet="translations"
297 layer="canonical.launchpad.layers.TranslationsLayer"/>297 layer="lp.translations.publisher.TranslationsLayer"/>
298 <facet298 <facet
299 facet="translations">299 facet="translations">
300 <browser:navigation300 <browser:navigation
@@ -304,7 +304,7 @@
304 <browser:defaultView304 <browser:defaultView
305 for="canonical.launchpad.interfaces.ILanguage"305 for="canonical.launchpad.interfaces.ILanguage"
306 name="+index"306 name="+index"
307 layer="canonical.launchpad.layers.TranslationsLayer"/>307 layer="lp.translations.publisher.TranslationsLayer"/>
308 <browser:menus308 <browser:menus
309 module="lp.translations.browser.language"309 module="lp.translations.browser.language"
310 classes="310 classes="
@@ -321,19 +321,19 @@
321 permission="zope.Public"321 permission="zope.Public"
322 template="../templates/language-index.pt"322 template="../templates/language-index.pt"
323 name="+index"323 name="+index"
324 layer="canonical.launchpad.layers.TranslationsLayer"/>324 layer="lp.translations.publisher.TranslationsLayer"/>
325 <browser:page325 <browser:page
326 for="canonical.launchpad.interfaces.ILanguage"326 for="canonical.launchpad.interfaces.ILanguage"
327 class="lp.translations.browser.language.LanguageAdminView"327 class="lp.translations.browser.language.LanguageAdminView"
328 permission="launchpad.Admin"328 permission="launchpad.Admin"
329 template="../../app/templates/generic-edit.pt"329 template="../../app/templates/generic-edit.pt"
330 name="+admin"330 name="+admin"
331 layer="canonical.launchpad.layers.TranslationsLayer"/>331 layer="lp.translations.publisher.TranslationsLayer"/>
332 <browser:pages332 <browser:pages
333 for="canonical.launchpad.interfaces.ILanguage"333 for="canonical.launchpad.interfaces.ILanguage"
334 class="lp.translations.browser.language.LanguageView"334 class="lp.translations.browser.language.LanguageView"
335 permission="zope.Public"335 permission="zope.Public"
336 layer="canonical.launchpad.layers.TranslationsLayer">336 layer="lp.translations.publisher.TranslationsLayer">
337 <browser:page337 <browser:page
338 name="+portlet-details"338 name="+portlet-details"
339 template="../templates/language-portlet-details.pt"/>339 template="../templates/language-portlet-details.pt"/>
@@ -344,7 +344,7 @@
344 <browser:defaultView344 <browser:defaultView
345 for="canonical.launchpad.interfaces.ILanguageSet"345 for="canonical.launchpad.interfaces.ILanguageSet"
346 name="+index"346 name="+index"
347 layer="canonical.launchpad.layers.TranslationsLayer"/>347 layer="lp.translations.publisher.TranslationsLayer"/>
348 <browser:url348 <browser:url
349 for="canonical.launchpad.interfaces.ILanguageSet"349 for="canonical.launchpad.interfaces.ILanguageSet"
350 path_expression="string:+languages"350 path_expression="string:+languages"
@@ -356,14 +356,14 @@
356 permission="zope.Public"356 permission="zope.Public"
357 template="../templates/languageset-index.pt"357 template="../templates/languageset-index.pt"
358 name="+index"358 name="+index"
359 layer="canonical.launchpad.layers.TranslationsLayer"/>359 layer="lp.translations.publisher.TranslationsLayer"/>
360 <browser:page360 <browser:page
361 for="canonical.launchpad.interfaces.ILanguageSet"361 for="canonical.launchpad.interfaces.ILanguageSet"
362 class="lp.translations.browser.language.LanguageAddView"362 class="lp.translations.browser.language.LanguageAddView"
363 permission="launchpad.Admin"363 permission="launchpad.Admin"
364 template="../../app/templates/generic-edit.pt"364 template="../../app/templates/generic-edit.pt"
365 name="+add"365 name="+add"
366 layer="canonical.launchpad.layers.TranslationsLayer"/>366 layer="lp.translations.publisher.TranslationsLayer"/>
367 <browser:navigation367 <browser:navigation
368 module="lp.translations.browser.potemplate"368 module="lp.translations.browser.potemplate"
369 classes="369 classes="
@@ -373,19 +373,19 @@
373 <browser:defaultView373 <browser:defaultView
374 for="lp.translations.interfaces.potemplate.IPOTemplate"374 for="lp.translations.interfaces.potemplate.IPOTemplate"
375 name="+index"375 name="+index"
376 layer="canonical.launchpad.layers.TranslationsLayer"/>376 layer="lp.translations.publisher.TranslationsLayer"/>
377 <browser:page377 <browser:page
378 name="+preferred-chart"378 name="+preferred-chart"
379 for="lp.translations.interfaces.potemplate.IPOTemplate"379 for="lp.translations.interfaces.potemplate.IPOTemplate"
380 class="lp.translations.browser.potemplate.POTemplateViewPreferred"380 class="lp.translations.browser.potemplate.POTemplateViewPreferred"
381 permission="zope.Public"381 permission="zope.Public"
382 template="../templates/potemplate-chart.pt"382 template="../templates/potemplate-chart.pt"
383 layer="canonical.launchpad.layers.TranslationsLayer"/>383 layer="lp.translations.publisher.TranslationsLayer"/>
384 <browser:pages384 <browser:pages
385 for="lp.translations.interfaces.potemplate.IPOTemplate"385 for="lp.translations.interfaces.potemplate.IPOTemplate"
386 class="lp.translations.browser.potemplate.POTemplateView"386 class="lp.translations.browser.potemplate.POTemplateView"
387 permission="zope.Public"387 permission="zope.Public"
388 layer="canonical.launchpad.layers.TranslationsLayer">388 layer="lp.translations.publisher.TranslationsLayer">
389 <browser:page389 <browser:page
390 name="+index"390 name="+index"
391 template="../templates/potemplate-index.pt"/>391 template="../templates/potemplate-index.pt"/>
@@ -408,28 +408,28 @@
408 permission="launchpad.Edit"408 permission="launchpad.Edit"
409 template="../templates/potemplate-upload.pt"409 template="../templates/potemplate-upload.pt"
410 class="lp.translations.browser.potemplate.POTemplateUploadView"410 class="lp.translations.browser.potemplate.POTemplateUploadView"
411 layer="canonical.launchpad.layers.TranslationsLayer"/>411 layer="lp.translations.publisher.TranslationsLayer"/>
412 <browser:page412 <browser:page
413 name="+edit"413 name="+edit"
414 for="lp.translations.interfaces.potemplate.IPOTemplate"414 for="lp.translations.interfaces.potemplate.IPOTemplate"
415 class="lp.translations.browser.potemplate.POTemplateEditView"415 class="lp.translations.browser.potemplate.POTemplateEditView"
416 permission="launchpad.Edit"416 permission="launchpad.Edit"
417 template="../../app/templates/generic-edit.pt"417 template="../../app/templates/generic-edit.pt"
418 layer="canonical.launchpad.layers.TranslationsLayer"/>418 layer="lp.translations.publisher.TranslationsLayer"/>
419 <browser:page419 <browser:page
420 name="+admin"420 name="+admin"
421 for="lp.translations.interfaces.potemplate.IPOTemplate"421 for="lp.translations.interfaces.potemplate.IPOTemplate"
422 class="lp.translations.browser.potemplate.POTemplateAdminView"422 class="lp.translations.browser.potemplate.POTemplateAdminView"
423 permission="launchpad.TranslationsAdmin"423 permission="launchpad.TranslationsAdmin"
424 template="../../app/templates/generic-edit.pt"424 template="../../app/templates/generic-edit.pt"
425 layer="canonical.launchpad.layers.TranslationsLayer"/>425 layer="lp.translations.publisher.TranslationsLayer"/>
426 <browser:page426 <browser:page
427 name="+export"427 name="+export"
428 for="lp.translations.interfaces.potemplate.IPOTemplate"428 for="lp.translations.interfaces.potemplate.IPOTemplate"
429 permission="launchpad.AnyPerson"429 permission="launchpad.AnyPerson"
430 template="../templates/potemplate-export.pt"430 template="../templates/potemplate-export.pt"
431 class="lp.translations.browser.potemplate.POTemplateExportView"431 class="lp.translations.browser.potemplate.POTemplateExportView"
432 layer="canonical.launchpad.layers.TranslationsLayer"/>432 layer="lp.translations.publisher.TranslationsLayer"/>
433 <browser:menus433 <browser:menus
434 module="lp.translations.browser.potemplate"434 module="lp.translations.browser.potemplate"
435 classes="435 classes="
@@ -444,14 +444,14 @@
444 <browser:defaultView444 <browser:defaultView
445 for="lp.translations.interfaces.potemplate.IPOTemplateSubset"445 for="lp.translations.interfaces.potemplate.IPOTemplateSubset"
446 name="+index"446 name="+index"
447 layer="canonical.launchpad.layers.TranslationsLayer"/>447 layer="lp.translations.publisher.TranslationsLayer"/>
448 <browser:page448 <browser:page
449 name="+index"449 name="+index"
450 for="lp.translations.interfaces.potemplate.IPOTemplateSubset"450 for="lp.translations.interfaces.potemplate.IPOTemplateSubset"
451 permission="zope.Public"451 permission="zope.Public"
452 class="lp.translations.browser.potemplate.POTemplateSubsetView"452 class="lp.translations.browser.potemplate.POTemplateSubsetView"
453 attribute="__call__"453 attribute="__call__"
454 layer="canonical.launchpad.layers.TranslationsLayer"/>454 layer="lp.translations.publisher.TranslationsLayer"/>
455 <browser:navigation455 <browser:navigation
456 module="lp.translations.browser.translationgroup"456 module="lp.translations.browser.translationgroup"
457 classes="457 classes="
@@ -460,7 +460,7 @@
460 <browser:defaultView460 <browser:defaultView
461 for="lp.translations.interfaces.translationgroup.ITranslationGroup"461 for="lp.translations.interfaces.translationgroup.ITranslationGroup"
462 name="+index"462 name="+index"
463 layer="canonical.launchpad.layers.TranslationsLayer"/>463 layer="lp.translations.publisher.TranslationsLayer"/>
464 <browser:url464 <browser:url
465 for="lp.translations.interfaces.translationgroup.ITranslationGroup"465 for="lp.translations.interfaces.translationgroup.ITranslationGroup"
466 path_expression="name"466 path_expression="name"
@@ -470,7 +470,7 @@
470 for="lp.translations.interfaces.translationgroup.ITranslationGroup"470 for="lp.translations.interfaces.translationgroup.ITranslationGroup"
471 class="lp.translations.browser.translationgroup.TranslationGroupView"471 class="lp.translations.browser.translationgroup.TranslationGroupView"
472 permission="zope.Public"472 permission="zope.Public"
473 layer="canonical.launchpad.layers.TranslationsLayer">473 layer="lp.translations.publisher.TranslationsLayer">
474 <browser:page474 <browser:page
475 template="../templates/translationgroup-index.pt"475 template="../templates/translationgroup-index.pt"
476 name="+index"/>476 name="+index"/>
@@ -487,27 +487,27 @@
487 permission="launchpad.Edit"487 permission="launchpad.Edit"
488 class="lp.translations.browser.translationgroup.TranslationGroupEditView"488 class="lp.translations.browser.translationgroup.TranslationGroupEditView"
489 template="../../app/templates/generic-edit.pt"489 template="../../app/templates/generic-edit.pt"
490 layer="canonical.launchpad.layers.TranslationsLayer"/>490 layer="lp.translations.publisher.TranslationsLayer"/>
491 <browser:page491 <browser:page
492 name="+appoint"492 name="+appoint"
493 for="lp.translations.interfaces.translationgroup.ITranslationGroup"493 for="lp.translations.interfaces.translationgroup.ITranslationGroup"
494 permission="launchpad.Edit"494 permission="launchpad.Edit"
495 class="lp.translations.browser.translationgroup.TranslationGroupAddTranslatorView"495 class="lp.translations.browser.translationgroup.TranslationGroupAddTranslatorView"
496 template="../../app/templates/generic-edit.pt"496 template="../../app/templates/generic-edit.pt"
497 layer="canonical.launchpad.layers.TranslationsLayer"/>497 layer="lp.translations.publisher.TranslationsLayer"/>
498 <browser:page498 <browser:page
499 name="+reassign"499 name="+reassign"
500 for="lp.translations.interfaces.translationgroup.ITranslationGroup"500 for="lp.translations.interfaces.translationgroup.ITranslationGroup"
501 permission="launchpad.Edit"501 permission="launchpad.Edit"
502 class="lp.translations.browser.translationgroup.TranslationGroupReassignmentView"502 class="lp.translations.browser.translationgroup.TranslationGroupReassignmentView"
503 template="../templates/translationgroup-reassignment.pt"503 template="../templates/translationgroup-reassignment.pt"
504 layer="canonical.launchpad.layers.TranslationsLayer"/>504 layer="lp.translations.publisher.TranslationsLayer"/>
505 <browser:page505 <browser:page
506 for="*"506 for="*"
507 permission="launchpad.Edit"507 permission="launchpad.Edit"
508 name="+object-reassignment"508 name="+object-reassignment"
509 template="../../../canonical/launchpad/templates/object-reassignment.pt"509 template="../../../canonical/launchpad/templates/object-reassignment.pt"
510 layer="canonical.launchpad.layers.TranslationsLayer"/>510 layer="lp.translations.publisher.TranslationsLayer"/>
511 <browser:url511 <browser:url
512 for="lp.translations.interfaces.translationgroup.ITranslationGroupSet"512 for="lp.translations.interfaces.translationgroup.ITranslationGroupSet"
513 path_expression="string:+groups"513 path_expression="string:+groups"
@@ -516,21 +516,21 @@
516 <browser:defaultView516 <browser:defaultView
517 for="lp.translations.interfaces.translationgroup.ITranslationGroupSet"517 for="lp.translations.interfaces.translationgroup.ITranslationGroupSet"
518 name="+index"518 name="+index"
519 layer="canonical.launchpad.layers.TranslationsLayer"/>519 layer="lp.translations.publisher.TranslationsLayer"/>
520 <browser:page520 <browser:page
521 name="+new"521 name="+new"
522 for="lp.translations.interfaces.translationgroup.ITranslationGroupSet"522 for="lp.translations.interfaces.translationgroup.ITranslationGroupSet"
523 class="lp.translations.browser.translationgroup.TranslationGroupAddView"523 class="lp.translations.browser.translationgroup.TranslationGroupAddView"
524 permission="launchpad.Admin"524 permission="launchpad.Admin"
525 template="../../app/templates/generic-edit.pt"525 template="../../app/templates/generic-edit.pt"
526 layer="canonical.launchpad.layers.TranslationsLayer"/>526 layer="lp.translations.publisher.TranslationsLayer"/>
527 <browser:page527 <browser:page
528 for="lp.translations.interfaces.translationgroup.ITranslationGroupSet"528 for="lp.translations.interfaces.translationgroup.ITranslationGroupSet"
529 class="lp.translations.browser.translationgroup.TranslationGroupSetView"529 class="lp.translations.browser.translationgroup.TranslationGroupSetView"
530 permission="zope.Public"530 permission="zope.Public"
531 template="../templates/translationgroups-index.pt"531 template="../templates/translationgroups-index.pt"
532 name="+index"532 name="+index"
533 layer="canonical.launchpad.layers.TranslationsLayer"/>533 layer="lp.translations.publisher.TranslationsLayer"/>
534 <browser:url534 <browser:url
535 for="lp.translations.interfaces.translationmessage.ITranslationMessage"535 for="lp.translations.interfaces.translationmessage.ITranslationMessage"
536 path_expression="string:${potmsgset/sequence}"536 path_expression="string:${potmsgset/sequence}"
@@ -544,13 +544,13 @@
544 <browser:defaultView544 <browser:defaultView
545 for="lp.translations.interfaces.translationmessage.ITranslationMessage"545 for="lp.translations.interfaces.translationmessage.ITranslationMessage"
546 name="+index"546 name="+index"
547 layer="canonical.launchpad.layers.TranslationsLayer"/>547 layer="lp.translations.publisher.TranslationsLayer"/>
548 <browser:page548 <browser:page
549 for="lp.translations.interfaces.translationmessage.ITranslationMessage"549 for="lp.translations.interfaces.translationmessage.ITranslationMessage"
550 class="lp.translations.browser.translationmessage.CurrentTranslationMessageIndexView"550 class="lp.translations.browser.translationmessage.CurrentTranslationMessageIndexView"
551 permission="zope.Public"551 permission="zope.Public"
552 name="+index"552 name="+index"
553 layer="canonical.launchpad.layers.TranslationsLayer"/>553 layer="lp.translations.publisher.TranslationsLayer"/>
554 <browser:page554 <browser:page
555 name="+translate"555 name="+translate"
556 for="lp.translations.interfaces.translationmessage.ITranslationMessage"556 for="lp.translations.interfaces.translationmessage.ITranslationMessage"
@@ -562,20 +562,20 @@
562 permission="zope.Public"562 permission="zope.Public"
563 template="../templates/translationmessage-translate.pt"563 template="../templates/translationmessage-translate.pt"
564 class="lp.translations.browser.translationmessage.CurrentTranslationMessagePageView"564 class="lp.translations.browser.translationmessage.CurrentTranslationMessagePageView"
565 layer="canonical.launchpad.layers.TranslationsLayer"/>565 layer="lp.translations.publisher.TranslationsLayer"/>
566 <browser:page566 <browser:page
567 name="+display"567 name="+display"
568 for="lp.translations.interfaces.translationmessage.ITranslationMessageSuggestions"568 for="lp.translations.interfaces.translationmessage.ITranslationMessageSuggestions"
569 permission="launchpad.AnyPerson"569 permission="launchpad.AnyPerson"
570 template="../templates/translationmessage-suggestions.pt"570 template="../templates/translationmessage-suggestions.pt"
571 layer="canonical.launchpad.layers.TranslationsLayer"/>571 layer="lp.translations.publisher.TranslationsLayer"/>
572572
573<!-- SourcePackage translation pages -->573<!-- SourcePackage translation pages -->
574574
575 <browser:defaultView575 <browser:defaultView
576 for="lp.registry.interfaces.sourcepackage.ISourcePackage"576 for="lp.registry.interfaces.sourcepackage.ISourcePackage"
577 name="+translations"577 name="+translations"
578 layer="canonical.launchpad.layers.TranslationsLayer"/>578 layer="lp.translations.publisher.TranslationsLayer"/>
579 <browser:menus579 <browser:menus
580 classes="SourcePackageTranslationsMenu"580 classes="SourcePackageTranslationsMenu"
581 module="lp.translations.browser.sourcepackage"/>581 module="lp.translations.browser.sourcepackage"/>
@@ -586,11 +586,11 @@
586 class="lp.translations.browser.hastranslationimports.HasTranslationImportsView"586 class="lp.translations.browser.hastranslationimports.HasTranslationImportsView"
587 permission="zope.Public"587 permission="zope.Public"
588 template="../templates/hastranslationimports-index.pt"588 template="../templates/hastranslationimports-index.pt"
589 layer="canonical.launchpad.layers.TranslationsLayer"/>589 layer="lp.translations.publisher.TranslationsLayer"/>
590 <browser:page590 <browser:page
591 for="lp.registry.interfaces.sourcepackage.ISourcePackage"591 for="lp.registry.interfaces.sourcepackage.ISourcePackage"
592 name="+export"592 name="+export"
593 layer="canonical.launchpad.layers.TranslationsLayer"593 layer="lp.translations.publisher.TranslationsLayer"
594 permission="launchpad.ExpensiveRequest"594 permission="launchpad.ExpensiveRequest"
595 template="../templates/translations-export.pt"595 template="../templates/translations-export.pt"
596 class="596 class="
@@ -609,7 +609,7 @@
609 for="lp.registry.interfaces.sourcepackage.ISourcePackage"609 for="lp.registry.interfaces.sourcepackage.ISourcePackage"
610 permission="zope.Public"610 permission="zope.Public"
611 class="lp.translations.browser.sourcepackage.SourcePackageTranslationsView"611 class="lp.translations.browser.sourcepackage.SourcePackageTranslationsView"
612 layer="canonical.launchpad.layers.TranslationsLayer">612 layer="lp.translations.publisher.TranslationsLayer">
613 <browser:page613 <browser:page
614 name="+potlist"614 name="+potlist"
615 template="../templates/object-pots.pt"/>615 template="../templates/object-pots.pt"/>
@@ -623,7 +623,7 @@
623 <browser:defaultView623 <browser:defaultView
624 for="lp.registry.interfaces.productseries.IProductSeries"624 for="lp.registry.interfaces.productseries.IProductSeries"
625 name="+translations"625 name="+translations"
626 layer="canonical.launchpad.layers.TranslationsLayer"/>626 layer="lp.translations.publisher.TranslationsLayer"/>
627 <browser:menus627 <browser:menus
628 classes="ProductSeriesTranslationsMenu"628 classes="ProductSeriesTranslationsMenu"
629 module="lp.translations.browser.productseries"/>629 module="lp.translations.browser.productseries"/>
@@ -636,7 +636,7 @@
636 for="lp.registry.interfaces.productseries.IProductSeries"636 for="lp.registry.interfaces.productseries.IProductSeries"
637 class="lp.translations.browser.productseries.ProductSeriesView"637 class="lp.translations.browser.productseries.ProductSeriesView"
638 permission="zope.Public"638 permission="zope.Public"
639 layer="canonical.launchpad.layers.TranslationsLayer" >639 layer="lp.translations.publisher.TranslationsLayer" >
640 <browser:page640 <browser:page
641 name="+translations"641 name="+translations"
642 template="../templates/productseries-translations.pt"642 template="../templates/productseries-translations.pt"
@@ -650,7 +650,7 @@
650 for="lp.registry.interfaces.productseries.IProductSeries"650 for="lp.registry.interfaces.productseries.IProductSeries"
651 class="lp.translations.browser.productseries.ProductSeriesUploadView"651 class="lp.translations.browser.productseries.ProductSeriesUploadView"
652 permission="launchpad.Edit"652 permission="launchpad.Edit"
653 layer="canonical.launchpad.layers.TranslationsLayer">653 layer="lp.translations.publisher.TranslationsLayer">
654 <browser:page654 <browser:page
655 name="+translations-upload"655 name="+translations-upload"
656 template="../templates/productseries-translations-upload.pt"/>656 template="../templates/productseries-translations-upload.pt"/>
@@ -661,38 +661,38 @@
661 class="lp.translations.browser.hastranslationimports.HasTranslationImportsView"661 class="lp.translations.browser.hastranslationimports.HasTranslationImportsView"
662 permission="zope.Public"662 permission="zope.Public"
663 template="../templates/hastranslationimports-index.pt"663 template="../templates/hastranslationimports-index.pt"
664 layer="canonical.launchpad.layers.TranslationsLayer"/>664 layer="lp.translations.publisher.TranslationsLayer"/>
665 <browser:page665 <browser:page
666 for="lp.registry.interfaces.productseries.IProductSeries"666 for="lp.registry.interfaces.productseries.IProductSeries"
667 name="+translations-settings"667 name="+translations-settings"
668 class="lp.translations.browser.productseries.ProductSeriesTranslationsSettingsView"668 class="lp.translations.browser.productseries.ProductSeriesTranslationsSettingsView"
669 permission="launchpad.Edit"669 permission="launchpad.Edit"
670 template="../templates/productseries-translations-settings.pt"670 template="../templates/productseries-translations-settings.pt"
671 layer="canonical.launchpad.layers.TranslationsLayer"/>671 layer="lp.translations.publisher.TranslationsLayer"/>
672 <browser:page672 <browser:page
673 for="lp.registry.interfaces.productseries.IProductSeries"673 for="lp.registry.interfaces.productseries.IProductSeries"
674 name="+templates"674 name="+templates"
675 class="lp.translations.browser.productseries.ProductSeriesTemplatesView"675 class="lp.translations.browser.productseries.ProductSeriesTemplatesView"
676 permission="zope.Public"676 permission="zope.Public"
677 template="../templates/object-templates.pt"677 template="../templates/object-templates.pt"
678 layer="canonical.launchpad.layers.TranslationsLayer"/>678 layer="lp.translations.publisher.TranslationsLayer"/>
679 <browser:page679 <browser:page
680 for="lp.registry.interfaces.productseries.IProductSeries"680 for="lp.registry.interfaces.productseries.IProductSeries"
681 name="+request-bzr-import"681 name="+request-bzr-import"
682 class="lp.translations.browser.productseries.ProductSeriesTranslationsBzrImportView"682 class="lp.translations.browser.productseries.ProductSeriesTranslationsBzrImportView"
683 permission="launchpad.Edit"683 permission="launchpad.Edit"
684 template="../templates/productseries-translations-bzr-import.pt"684 template="../templates/productseries-translations-bzr-import.pt"
685 layer="canonical.launchpad.layers.TranslationsLayer"/>685 layer="lp.translations.publisher.TranslationsLayer"/>
686 <browser:page686 <browser:page
687 name="+export"687 name="+export"
688 layer="canonical.launchpad.layers.TranslationsLayer"688 layer="lp.translations.publisher.TranslationsLayer"
689 for="lp.registry.interfaces.productseries.IProductSeries"689 for="lp.registry.interfaces.productseries.IProductSeries"
690 permission="launchpad.AnyPerson"690 permission="launchpad.AnyPerson"
691 template="../templates/translations-export.pt"691 template="../templates/translations-export.pt"
692 class="lp.translations.browser.productseries.ProductSeriesTranslationsExportView"/>692 class="lp.translations.browser.productseries.ProductSeriesTranslationsExportView"/>
693 <browser:page693 <browser:page
694 name="+link-translations-branch"694 name="+link-translations-branch"
695 layer="canonical.launchpad.layers.TranslationsLayer"695 layer="lp.translations.publisher.TranslationsLayer"
696 for="lp.registry.interfaces.productseries.IProductSeries"696 for="lp.registry.interfaces.productseries.IProductSeries"
697 permission="launchpad.Edit"697 permission="launchpad.Edit"
698 template="../../app/templates/generic-edit.pt"698 template="../../app/templates/generic-edit.pt"
@@ -703,7 +703,7 @@
703 <browser:defaultView703 <browser:defaultView
704 for="lp.registry.interfaces.person.IPerson"704 for="lp.registry.interfaces.person.IPerson"
705 name="+translations"705 name="+translations"
706 layer="canonical.launchpad.layers.TranslationsLayer"/>706 layer="lp.translations.publisher.TranslationsLayer"/>
707 <browser:menus707 <browser:menus
708 module="lp.translations.browser.person"708 module="lp.translations.browser.person"
709 classes="709 classes="
@@ -720,7 +720,7 @@
720 class="lp.translations.browser.person.PersonTranslationView"720 class="lp.translations.browser.person.PersonTranslationView"
721 permission="zope.Public"721 permission="zope.Public"
722 template="../templates/person-translations.pt"722 template="../templates/person-translations.pt"
723 layer="canonical.launchpad.layers.TranslationsLayer"/>723 layer="lp.translations.publisher.TranslationsLayer"/>
724 <browser:page724 <browser:page
725 for="lp.registry.interfaces.person.IPerson"725 for="lp.registry.interfaces.person.IPerson"
726 name="+licensing"726 name="+licensing"
@@ -728,14 +728,14 @@
728 lp.translations.browser.person.PersonTranslationRelicensingView"728 lp.translations.browser.person.PersonTranslationRelicensingView"
729 permission="launchpad.Edit"729 permission="launchpad.Edit"
730 template="../templates/person-translations-relicensing.pt"730 template="../templates/person-translations-relicensing.pt"
731 layer="canonical.launchpad.layers.TranslationsLayer"/>731 layer="lp.translations.publisher.TranslationsLayer"/>
732 <browser:page732 <browser:page
733 for="lp.registry.interfaces.person.IPerson"733 for="lp.registry.interfaces.person.IPerson"
734 name="+imports"734 name="+imports"
735 class="lp.translations.browser.hastranslationimports.HasTranslationImportsView"735 class="lp.translations.browser.hastranslationimports.HasTranslationImportsView"
736 permission="zope.Public"736 permission="zope.Public"
737 template="../templates/hastranslationimports-index.pt"737 template="../templates/hastranslationimports-index.pt"
738 layer="canonical.launchpad.layers.TranslationsLayer"/>738 layer="lp.translations.publisher.TranslationsLayer"/>
739 <browser:page739 <browser:page
740 for="lp.registry.interfaces.person.IPerson"740 for="lp.registry.interfaces.person.IPerson"
741 class="lp.translations.browser.person.PersonTranslationView"741 class="lp.translations.browser.person.PersonTranslationView"
@@ -748,35 +748,35 @@
748 class="lp.translations.browser.person.TranslationActivityView"748 class="lp.translations.browser.person.TranslationActivityView"
749 permission="zope.Public"749 permission="zope.Public"
750 template="../templates/person-translation-activity.pt"750 template="../templates/person-translation-activity.pt"
751 layer="canonical.launchpad.layers.TranslationsLayer"/>751 layer="lp.translations.publisher.TranslationsLayer"/>
752 <browser:page752 <browser:page
753 for="lp.registry.interfaces.person.IPerson"753 for="lp.registry.interfaces.person.IPerson"
754 name="+translations-to-review"754 name="+translations-to-review"
755 class="lp.translations.browser.person.PersonTranslationReviewView"755 class="lp.translations.browser.person.PersonTranslationReviewView"
756 permission="zope.Public"756 permission="zope.Public"
757 template="../templates/person-translations-to-review.pt"757 template="../templates/person-translations-to-review.pt"
758 layer="canonical.launchpad.layers.TranslationsLayer"/>758 layer="lp.translations.publisher.TranslationsLayer"/>
759 <browser:page759 <browser:page
760 for="lp.registry.interfaces.person.IPerson"760 for="lp.registry.interfaces.person.IPerson"
761 name="+translations-to-review-table"761 name="+translations-to-review-table"
762 class="lp.translations.browser.person.PersonTranslationView"762 class="lp.translations.browser.person.PersonTranslationView"
763 permission="zope.Public"763 permission="zope.Public"
764 template="../templates/person-translations-to-review-table.pt"764 template="../templates/person-translations-to-review-table.pt"
765 layer="canonical.launchpad.layers.TranslationsLayer"/>765 layer="lp.translations.publisher.TranslationsLayer"/>
766 <browser:page766 <browser:page
767 for="lp.registry.interfaces.person.IPerson"767 for="lp.registry.interfaces.person.IPerson"
768 name="+translations-to-complete-table"768 name="+translations-to-complete-table"
769 class="lp.translations.browser.person.PersonTranslationView"769 class="lp.translations.browser.person.PersonTranslationView"
770 permission="zope.Public"770 permission="zope.Public"
771 template="../templates/person-translations-to-complete-table.pt"771 template="../templates/person-translations-to-complete-table.pt"
772 layer="canonical.launchpad.layers.TranslationsLayer"/>772 layer="lp.translations.publisher.TranslationsLayer"/>
773773
774774
775<!-- Product views -->775<!-- Product views -->
776776
777 <browser:defaultView777 <browser:defaultView
778 for="lp.registry.interfaces.product.IProduct"778 for="lp.registry.interfaces.product.IProduct"
779 layer="canonical.launchpad.layers.TranslationsLayer"779 layer="lp.translations.publisher.TranslationsLayer"
780 name="+translations"/>780 name="+translations"/>
781 <browser:menus781 <browser:menus
782 classes="782 classes="
@@ -798,19 +798,19 @@
798 class="lp.translations.browser.hastranslationimports.HasTranslationImportsView"798 class="lp.translations.browser.hastranslationimports.HasTranslationImportsView"
799 permission="zope.Public"799 permission="zope.Public"
800 template="../templates/hastranslationimports-index.pt"800 template="../templates/hastranslationimports-index.pt"
801 layer="canonical.launchpad.layers.TranslationsLayer"/>801 layer="lp.translations.publisher.TranslationsLayer"/>
802 <browser:page802 <browser:page
803 name="+settings"803 name="+settings"
804 for="lp.registry.interfaces.product.IProduct"804 for="lp.registry.interfaces.product.IProduct"
805 class="lp.translations.browser.product.ProductSettingsView"805 class="lp.translations.browser.product.ProductSettingsView"
806 permission="launchpad.TranslationsAdmin"806 permission="launchpad.TranslationsAdmin"
807 template="../templates/set-translators.pt"807 template="../templates/set-translators.pt"
808 layer="canonical.launchpad.layers.TranslationsLayer"/>808 layer="lp.translations.publisher.TranslationsLayer"/>
809 <browser:pages809 <browser:pages
810 for="lp.registry.interfaces.product.IProduct"810 for="lp.registry.interfaces.product.IProduct"
811 permission="zope.Public"811 permission="zope.Public"
812 class="lp.translations.browser.product.ProductView"812 class="lp.translations.browser.product.ProductView"
813 layer="canonical.launchpad.layers.TranslationsLayer">813 layer="lp.translations.publisher.TranslationsLayer">
814 <browser:page814 <browser:page
815 name="+translations"815 name="+translations"
816 template="../templates/product-translations.pt"/>816 template="../templates/product-translations.pt"/>
@@ -830,7 +830,7 @@
830 <browser:defaultView830 <browser:defaultView
831 for="lp.registry.interfaces.projectgroup.IProjectGroup"831 for="lp.registry.interfaces.projectgroup.IProjectGroup"
832 name="+translations"832 name="+translations"
833 layer="canonical.launchpad.layers.TranslationsLayer"/>833 layer="lp.translations.publisher.TranslationsLayer"/>
834 <browser:menus834 <browser:menus
835 classes="835 classes="
836 ProjectTranslationsMenu"836 ProjectTranslationsMenu"
@@ -846,7 +846,7 @@
846 name="+translations"846 name="+translations"
847 class="lp.translations.browser.project.ProjectView"847 class="lp.translations.browser.project.ProjectView"
848 template="../templates/project-translations.pt"848 template="../templates/project-translations.pt"
849 layer="canonical.launchpad.layers.TranslationsLayer"/>849 layer="lp.translations.publisher.TranslationsLayer"/>
850 <browser:page850 <browser:page
851 name="+help-translate-button"851 name="+help-translate-button"
852 for="lp.registry.interfaces.projectgroup.IProjectGroup"852 for="lp.registry.interfaces.projectgroup.IProjectGroup"
@@ -858,14 +858,14 @@
858 class="lp.translations.browser.project.ProjectSettingsView"858 class="lp.translations.browser.project.ProjectSettingsView"
859 permission="launchpad.TranslationsAdmin"859 permission="launchpad.TranslationsAdmin"
860 template="../templates/set-translators.pt"860 template="../templates/set-translators.pt"
861 layer="canonical.launchpad.layers.TranslationsLayer"/>861 layer="lp.translations.publisher.TranslationsLayer"/>
862862
863<!-- Distribution -->863<!-- Distribution -->
864864
865 <browser:defaultView865 <browser:defaultView
866 for="lp.registry.interfaces.distribution.IDistribution"866 for="lp.registry.interfaces.distribution.IDistribution"
867 name="+translations"867 name="+translations"
868 layer="canonical.launchpad.layers.TranslationsLayer"/>868 layer="lp.translations.publisher.TranslationsLayer"/>
869 <browser:menus869 <browser:menus
870 classes="870 classes="
871 DistributionTranslationsMenu"871 DistributionTranslationsMenu"
@@ -881,7 +881,7 @@
881 permission="zope.Public"881 permission="zope.Public"
882 name="+translations"882 name="+translations"
883 template="../templates/distribution-translations.pt"883 template="../templates/distribution-translations.pt"
884 layer="canonical.launchpad.layers.TranslationsLayer"/>884 layer="lp.translations.publisher.TranslationsLayer"/>
885 <browser:page885 <browser:page
886 name="+help-translate-button"886 name="+help-translate-button"
887 for="lp.registry.interfaces.distribution.IDistribution"887 for="lp.registry.interfaces.distribution.IDistribution"
@@ -893,35 +893,35 @@
893 class="lp.translations.browser.distribution.DistributionSettingsView"893 class="lp.translations.browser.distribution.DistributionSettingsView"
894 permission="launchpad.TranslationsAdmin"894 permission="launchpad.TranslationsAdmin"
895 template="../templates/set-translators.pt"895 template="../templates/set-translators.pt"
896 layer="canonical.launchpad.layers.TranslationsLayer"/>896 layer="lp.translations.publisher.TranslationsLayer"/>
897 <browser:page897 <browser:page
898 for="lp.registry.interfaces.distribution.IDistribution"898 for="lp.registry.interfaces.distribution.IDistribution"
899 name="+imports"899 name="+imports"
900 class="lp.translations.browser.hastranslationimports.HasTranslationImportsView"900 class="lp.translations.browser.hastranslationimports.HasTranslationImportsView"
901 permission="zope.Public"901 permission="zope.Public"
902 template="../templates/hastranslationimports-index.pt"902 template="../templates/hastranslationimports-index.pt"
903 layer="canonical.launchpad.layers.TranslationsLayer"/>903 layer="lp.translations.publisher.TranslationsLayer"/>
904 <browser:page904 <browser:page
905 for="lp.registry.interfaces.distribution.IDistribution"905 for="lp.registry.interfaces.distribution.IDistribution"
906 name="+select-language-pack-admin"906 name="+select-language-pack-admin"
907 class="lp.translations.browser.distribution.DistributionLanguagePackAdminView"907 class="lp.translations.browser.distribution.DistributionLanguagePackAdminView"
908 permission="launchpad.TranslationsAdmin"908 permission="launchpad.TranslationsAdmin"
909 template="../../app/templates/generic-edit.pt"909 template="../../app/templates/generic-edit.pt"
910 layer="canonical.launchpad.layers.TranslationsLayer"/>910 layer="lp.translations.publisher.TranslationsLayer"/>
911 <!-- Language pack admin portlet -->911 <!-- Language pack admin portlet -->
912 <browser:page912 <browser:page
913 name="+language-pack-admin-info"913 name="+language-pack-admin-info"
914 for="lp.registry.interfaces.distribution.IDistribution"914 for="lp.registry.interfaces.distribution.IDistribution"
915 permission="launchpad.View"915 permission="launchpad.View"
916 template="../templates/distribution-language-pack-admin-info.pt"916 template="../templates/distribution-language-pack-admin-info.pt"
917 layer="canonical.launchpad.layers.TranslationsLayer"/>917 layer="lp.translations.publisher.TranslationsLayer"/>
918918
919<!-- DistroSeries -->919<!-- DistroSeries -->
920920
921 <browser:defaultView921 <browser:defaultView
922 for="lp.registry.interfaces.distroseries.IDistroSeries"922 for="lp.registry.interfaces.distroseries.IDistroSeries"
923 name="+translations"923 name="+translations"
924 layer="canonical.launchpad.layers.TranslationsLayer"/>924 layer="lp.translations.publisher.TranslationsLayer"/>
925 <browser:menus925 <browser:menus
926 classes="926 classes="
927 DistroSeriesTranslationsMenu"927 DistroSeriesTranslationsMenu"
@@ -936,7 +936,7 @@
936 for="lp.registry.interfaces.distroseries.IDistroSeries"936 for="lp.registry.interfaces.distroseries.IDistroSeries"
937 class="lp.translations.browser.distroseries.DistroSeriesView"937 class="lp.translations.browser.distroseries.DistroSeriesView"
938 permission="zope.Public"938 permission="zope.Public"
939 layer="canonical.launchpad.layers.TranslationsLayer">939 layer="lp.translations.publisher.TranslationsLayer">
940 <browser:page940 <browser:page
941 name="+translations"941 name="+translations"
942 template="../templates/distroseries-translations.pt"/>942 template="../templates/distroseries-translations.pt"/>
@@ -948,7 +948,7 @@
948 for="lp.registry.interfaces.distroseries.IDistroSeries"948 for="lp.registry.interfaces.distroseries.IDistroSeries"
949 class="lp.translations.browser.distroseries.DistroSeriesTemplatesView"949 class="lp.translations.browser.distroseries.DistroSeriesTemplatesView"
950 permission="zope.Public"950 permission="zope.Public"
951 layer="canonical.launchpad.layers.TranslationsLayer"951 layer="lp.translations.publisher.TranslationsLayer"
952 name="+templates"952 name="+templates"
953 template="../templates/object-templates.pt" />953 template="../templates/object-templates.pt" />
954 <browser:page954 <browser:page
@@ -962,19 +962,19 @@
962 class="lp.translations.browser.distroseries.DistroSeriesTranslationsAdminView"962 class="lp.translations.browser.distroseries.DistroSeriesTranslationsAdminView"
963 name="+admin"963 name="+admin"
964 template="../../app/templates/generic-edit.pt"964 template="../../app/templates/generic-edit.pt"
965 layer="canonical.launchpad.layers.TranslationsLayer"/>965 layer="lp.translations.publisher.TranslationsLayer"/>
966 <browser:page966 <browser:page
967 for="lp.registry.interfaces.distroseries.IDistroSeries"967 for="lp.registry.interfaces.distroseries.IDistroSeries"
968 name="+imports"968 name="+imports"
969 class="lp.translations.browser.hastranslationimports.HasTranslationImportsView"969 class="lp.translations.browser.hastranslationimports.HasTranslationImportsView"
970 permission="zope.Public"970 permission="zope.Public"
971 template="../templates/hastranslationimports-index.pt"971 template="../templates/hastranslationimports-index.pt"
972 layer="canonical.launchpad.layers.TranslationsLayer"/>972 layer="lp.translations.publisher.TranslationsLayer"/>
973 <browser:page973 <browser:page
974 for="lp.registry.interfaces.distroseries.IDistroSeries"974 for="lp.registry.interfaces.distroseries.IDistroSeries"
975 class="lp.translations.browser.distroseries.DistroSeriesLanguagePackView"975 class="lp.translations.browser.distroseries.DistroSeriesLanguagePackView"
976 permission="zope.Public"976 permission="zope.Public"
977 layer="canonical.launchpad.layers.TranslationsLayer"977 layer="lp.translations.publisher.TranslationsLayer"
978 name="+language-packs"978 name="+language-packs"
979 template="../templates/distroseries-language-packs.pt"/>979 template="../templates/distroseries-language-packs.pt"/>
980980
@@ -984,7 +984,7 @@
984 <browser:defaultView984 <browser:defaultView
985 for="lp.translations.interfaces.customlanguagecode.ICustomLanguageCode"985 for="lp.translations.interfaces.customlanguagecode.ICustomLanguageCode"
986 name="+index"986 name="+index"
987 layer="canonical.launchpad.layers.TranslationsLayer"/>987 layer="lp.translations.publisher.TranslationsLayer"/>
988 <browser:url988 <browser:url
989 for="lp.translations.interfaces.customlanguagecode.ICustomLanguageCode"989 for="lp.translations.interfaces.customlanguagecode.ICustomLanguageCode"
990 path_expression="string:+customcode/${language_code}"990 path_expression="string:+customcode/${language_code}"
@@ -996,7 +996,7 @@
996 permission="zope.Public"996 permission="zope.Public"
997 class="lp.translations.browser.customlanguagecode.CustomLanguageCodeView"997 class="lp.translations.browser.customlanguagecode.CustomLanguageCodeView"
998 template="../templates/customlanguagecode-index.pt"998 template="../templates/customlanguagecode-index.pt"
999 layer="canonical.launchpad.layers.TranslationsLayer"/>999 layer="lp.translations.publisher.TranslationsLayer"/>
10001000
1001 <browser:page1001 <browser:page
1002 name="+remove"1002 name="+remove"
@@ -1004,21 +1004,21 @@
1004 permission="launchpad.Admin"1004 permission="launchpad.Admin"
1005 class="lp.translations.browser.customlanguagecode.CustomLanguageCodeRemoveView"1005 class="lp.translations.browser.customlanguagecode.CustomLanguageCodeRemoveView"
1006 template="../../app/templates/generic-edit.pt"1006 template="../../app/templates/generic-edit.pt"
1007 layer="canonical.launchpad.layers.TranslationsLayer"/>1007 layer="lp.translations.publisher.TranslationsLayer"/>
10081008
1009<!-- IHasCustomLanguageCodes -->1009<!-- IHasCustomLanguageCodes -->
10101010
1011 <browser:page1011 <browser:page
1012 name="+custom-language-codes"1012 name="+custom-language-codes"
1013 for="lp.translations.interfaces.customlanguagecode.IHasCustomLanguageCodes"1013 for="lp.translations.interfaces.customlanguagecode.IHasCustomLanguageCodes"
1014 layer="canonical.launchpad.layers.TranslationsLayer"1014 layer="lp.translations.publisher.TranslationsLayer"
1015 class="lp.translations.browser.customlanguagecode.CustomLanguageCodesIndexView"1015 class="lp.translations.browser.customlanguagecode.CustomLanguageCodesIndexView"
1016 template="../templates/customlanguagecodes-index.pt"1016 template="../templates/customlanguagecodes-index.pt"
1017 permission="zope.Public"/>1017 permission="zope.Public"/>
1018 <browser:page1018 <browser:page
1019 name="+add-custom-language-code"1019 name="+add-custom-language-code"
1020 for="lp.translations.interfaces.customlanguagecode.IHasCustomLanguageCodes"1020 for="lp.translations.interfaces.customlanguagecode.IHasCustomLanguageCodes"
1021 layer="canonical.launchpad.layers.TranslationsLayer"1021 layer="lp.translations.publisher.TranslationsLayer"
1022 class="lp.translations.browser.customlanguagecode.CustomLanguageCodeAddView"1022 class="lp.translations.browser.customlanguagecode.CustomLanguageCodeAddView"
1023 template="../templates/customlanguagecode-add.pt"1023 template="../templates/customlanguagecode-add.pt"
1024 permission="launchpad.Admin"/>1024 permission="launchpad.Admin"/>
10251025
=== modified file 'lib/lp/translations/browser/tests/language-views.txt'
--- lib/lp/translations/browser/tests/language-views.txt 2010-04-21 13:08:48 +0000
+++ lib/lp/translations/browser/tests/language-views.txt 2010-07-22 20:59:01 +0000
@@ -6,7 +6,7 @@
66
7 >>> from zope.component import getUtility7 >>> from zope.component import getUtility
8 >>> from lp.services.worlddata.interfaces.language import ILanguageSet8 >>> from lp.services.worlddata.interfaces.language import ILanguageSet
9 >>> from canonical.launchpad.layers import TranslationsLayer9 >>> from lp.translations.publisher import TranslationsLayer
1010
11 >>> language_set = getUtility(ILanguageSet)11 >>> language_set = getUtility(ILanguageSet)
12 >>> portuguese = language_set.getLanguageByCode('pt_BR')12 >>> portuguese = language_set.getLanguageByCode('pt_BR')
1313
=== modified file 'lib/lp/translations/browser/tests/poexport-request-views.txt'
--- lib/lp/translations/browser/tests/poexport-request-views.txt 2009-07-02 17:16:50 +0000
+++ lib/lp/translations/browser/tests/poexport-request-views.txt 2010-07-22 20:59:01 +0000
@@ -1,7 +1,7 @@
1PO Export Request Browser Views1PO Export Request Browser Views
2-------------------------------2-------------------------------
33
4 >>> from canonical.launchpad.layers import TranslationsLayer4 >>> from lp.translations.publisher import TranslationsLayer
55
6Check there are no requests in the database to start with.6Check there are no requests in the database to start with.
77
88
=== modified file 'lib/lp/translations/browser/tests/pofile-views.txt'
--- lib/lp/translations/browser/tests/pofile-views.txt 2010-01-20 22:41:54 +0000
+++ lib/lp/translations/browser/tests/pofile-views.txt 2010-07-22 20:59:01 +0000
@@ -15,7 +15,7 @@
15 >>> from lp.registry.interfaces.distribution import IDistributionSet15 >>> from lp.registry.interfaces.distribution import IDistributionSet
16 >>> from lp.registry.interfaces.sourcepackagename import (16 >>> from lp.registry.interfaces.sourcepackagename import (
17 ... ISourcePackageNameSet)17 ... ISourcePackageNameSet)
18 >>> from canonical.launchpad.layers import TranslationsLayer18 >>> from lp.translations.publisher import TranslationsLayer
1919
20All the tests will be submitted as coming from the No Privilege person.20All the tests will be submitted as coming from the No Privilege person.
2121
2222
=== modified file 'lib/lp/translations/browser/tests/potemplate-views.txt'
--- lib/lp/translations/browser/tests/potemplate-views.txt 2009-07-02 17:16:50 +0000
+++ lib/lp/translations/browser/tests/potemplate-views.txt 2010-07-22 20:59:01 +0000
@@ -13,7 +13,7 @@
13 >>> from lp.registry.interfaces.distribution import IDistributionSet13 >>> from lp.registry.interfaces.distribution import IDistributionSet
14 >>> from lp.registry.interfaces.sourcepackagename import (14 >>> from lp.registry.interfaces.sourcepackagename import (
15 ... ISourcePackageNameSet)15 ... ISourcePackageNameSet)
16 >>> from canonical.launchpad.layers import TranslationsLayer16 >>> from lp.translations.publisher import TranslationsLayer
17 >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest17 >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest
1818
19All the tests will be submitted as comming from the No Privilege person.19All the tests will be submitted as comming from the No Privilege person.
2020
=== modified file 'lib/lp/translations/browser/tests/test_translationimportqueueentry.py'
--- lib/lp/translations/browser/tests/test_translationimportqueueentry.py 2010-04-19 15:24:29 +0000
+++ lib/lp/translations/browser/tests/test_translationimportqueueentry.py 2010-07-22 20:59:01 +0000
@@ -12,12 +12,13 @@
1212
13from canonical.testing import LaunchpadFunctionalLayer13from canonical.testing import LaunchpadFunctionalLayer
1414
15from canonical.launchpad.layers import TranslationsLayer, setFirstLayer15from canonical.launchpad.layers import setFirstLayer
16from canonical.launchpad.webapp import canonical_url16from canonical.launchpad.webapp import canonical_url
17from canonical.launchpad.webapp.servers import LaunchpadTestRequest17from canonical.launchpad.webapp.servers import LaunchpadTestRequest
18from lp.testing import TestCaseWithFactory18from lp.testing import TestCaseWithFactory
19from lp.translations.interfaces.translationimportqueue import (19from lp.translations.interfaces.translationimportqueue import (
20 ITranslationImportQueue)20 ITranslationImportQueue)
21from lp.translations.publisher import TranslationsLayer
2122
2223
23class TestTranslationImportQueueEntryView(TestCaseWithFactory):24class TestTranslationImportQueueEntryView(TestCaseWithFactory):
2425
=== modified file 'lib/lp/translations/browser/tests/translationimportqueue-views.txt'
--- lib/lp/translations/browser/tests/translationimportqueue-views.txt 2009-07-02 17:16:50 +0000
+++ lib/lp/translations/browser/tests/translationimportqueue-views.txt 2010-07-22 20:59:01 +0000
@@ -5,11 +5,12 @@
55
6 >>> from zope.component import getUtility, getMultiAdapter6 >>> from zope.component import getUtility, getMultiAdapter
7 >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest7 >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest
8 >>> from canonical.launchpad.layers import setFirstLayer
8 >>> from lp.translations.interfaces.translationimportqueue import (9 >>> from lp.translations.interfaces.translationimportqueue import (
9 ... ITranslationImportQueue)10 ... ITranslationImportQueue)
10 >>> from lp.translations.browser.translationimportqueue import (11 >>> from lp.translations.browser.translationimportqueue import (
11 ... TranslationImportQueueEntryView)12 ... TranslationImportQueueEntryView)
12 >>> from canonical.launchpad.layers import TranslationsLayer, setFirstLayer13 >>> from lp.translations.publisher import TranslationsLayer
1314
14This view is only accessible for administrators.15This view is only accessible for administrators.
1516
1617
=== modified file 'lib/lp/translations/browser/tests/translationmessage-views.txt'
--- lib/lp/translations/browser/tests/translationmessage-views.txt 2010-03-22 17:18:28 +0000
+++ lib/lp/translations/browser/tests/translationmessage-views.txt 2010-07-22 20:59:01 +0000
@@ -7,7 +7,7 @@
7 >>> from lp.translations.model.pofile import POFile7 >>> from lp.translations.model.pofile import POFile
8 >>> from lp.translations.model.translationmessage import (8 >>> from lp.translations.model.translationmessage import (
9 ... TranslationMessage)9 ... TranslationMessage)
10 >>> from canonical.launchpad.layers import TranslationsLayer10 >>> from lp.translations.publisher import TranslationsLayer
11 >>> from canonical.launchpad.webapp import canonical_url11 >>> from canonical.launchpad.webapp import canonical_url
1212
13All the tests will be submitted as comming from Kurem, an editor for the POFile13All the tests will be submitted as comming from Kurem, an editor for the POFile
1414
=== modified file 'lib/lp/translations/browser/tests/translator-views.txt'
--- lib/lp/translations/browser/tests/translator-views.txt 2009-09-17 11:28:13 +0000
+++ lib/lp/translations/browser/tests/translator-views.txt 2010-07-22 20:59:01 +0000
@@ -23,7 +23,7 @@
2323
24Translator +admin view provides a nice page title and a form label.24Translator +admin view provides a nice page title and a form label.
2525
26 >>> from canonical.launchpad.layers import TranslationsLayer26 >>> from lp.translations.publisher import TranslationsLayer
27 >>> view = create_initialized_view(translator, '+admin',27 >>> view = create_initialized_view(translator, '+admin',
28 ... layer=TranslationsLayer)28 ... layer=TranslationsLayer)
29 >>> print view.label29 >>> print view.label
@@ -45,7 +45,7 @@
45for a language in a TranslationGroup, and page title and form label45for a language in a TranslationGroup, and page title and form label
46describe that appropriately.46describe that appropriately.
4747
48 >>> from canonical.launchpad.layers import TranslationsLayer48 >>> from lp.translations.publisher import TranslationsLayer
49 >>> view = create_initialized_view(translator, '+edit',49 >>> view = create_initialized_view(translator, '+edit',
50 ... layer=TranslationsLayer)50 ... layer=TranslationsLayer)
51 >>> print view.label51 >>> print view.label
@@ -66,7 +66,7 @@
66Translator +edit view allows one to only set translation guidelines66Translator +edit view allows one to only set translation guidelines
67for a language in a TranslationGroup.67for a language in a TranslationGroup.
6868
69 >>> from canonical.launchpad.layers import TranslationsLayer69 >>> from lp.translations.publisher import TranslationsLayer
70 >>> view = create_initialized_view(translator, '+remove',70 >>> view = create_initialized_view(translator, '+remove',
71 ... layer=TranslationsLayer)71 ... layer=TranslationsLayer)
72 >>> print view.label72 >>> print view.label
7373
=== modified file 'lib/lp/translations/browser/translations.py'
--- lib/lp/translations/browser/translations.py 2010-02-01 21:20:57 +0000
+++ lib/lp/translations/browser/translations.py 2010-07-22 20:59:01 +0000
@@ -27,7 +27,7 @@
27from lp.registry.interfaces.product import IProductSet27from lp.registry.interfaces.product import IProductSet
28from lp.services.worlddata.interfaces.country import ICountry28from lp.services.worlddata.interfaces.country import ICountry
29from lp.registry.interfaces.person import IPersonSet29from lp.registry.interfaces.person import IPersonSet
30from canonical.launchpad.layers import TranslationsLayer30from lp.translations.publisher import TranslationsLayer
31from canonical.launchpad.webapp import (31from canonical.launchpad.webapp import (
32 LaunchpadView, Navigation, stepto, canonical_url)32 LaunchpadView, Navigation, stepto, canonical_url)
33from canonical.launchpad.webapp.batching import BatchNavigator33from canonical.launchpad.webapp.batching import BatchNavigator
@@ -183,7 +183,7 @@
183 self.request.response.redirect(183 self.request.response.redirect(
184 '/'.join([184 '/'.join([
185 canonical_url(self.context, rootsite='translations'),185 canonical_url(self.context, rootsite='translations'),
186 self.page186 self.page,
187 ]), status=301)187 ]), status=301)
188188
189189
@@ -208,6 +208,7 @@
208208
209class TranslationsLanguageBreadcrumb(Breadcrumb):209class TranslationsLanguageBreadcrumb(Breadcrumb):
210 """Breadcrumb for objects with language."""210 """Breadcrumb for objects with language."""
211
211 @property212 @property
212 def text(self):213 def text(self):
213 return self.context.language.displayname214 return self.context.language.displayname
214215
=== modified file 'lib/lp/translations/configure.zcml'
--- lib/lp/translations/configure.zcml 2010-07-19 13:30:29 +0000
+++ lib/lp/translations/configure.zcml 2010-07-22 20:59:01 +0000
@@ -13,8 +13,12 @@
13 <include13 <include
14 package=".browser"/>14 package=".browser"/>
1515
16 <publisher
17 name="translations"
18 factory="lp.translations.publisher.translations_request_publication_factory"/>
19
16 <lp:help-folder20 <lp:help-folder
17 folder="help" type="canonical.launchpad.layers.TranslationsLayer" />21 folder="help" type="lp.translations.publisher.TranslationsLayer" />
1822
19 <class23 <class
20 class="lp.translations.model.vpotexport.VPOTExport">24 class="lp.translations.model.vpotexport.VPOTExport">
2125
=== modified file 'lib/lp/translations/doc/rosetta-karma.txt'
--- lib/lp/translations/doc/rosetta-karma.txt 2010-02-16 20:36:48 +0000
+++ lib/lp/translations/doc/rosetta-karma.txt 2010-07-22 20:59:01 +0000
@@ -364,7 +364,7 @@
364product from where the IPOTemplate is and he has rights to change the364product from where the IPOTemplate is and he has rights to change the
365description.365description.
366366
367 >>> from canonical.launchpad.layers import TranslationsLayer367 >>> from lp.translations.publisher import TranslationsLayer
368 >>> sample_person = personset.getByEmail('test@canonical.com')368 >>> sample_person = personset.getByEmail('test@canonical.com')
369 >>> login('test@canonical.com')369 >>> login('test@canonical.com')
370 >>> form = {370 >>> form = {
371371
=== added file 'lib/lp/translations/publisher.py'
--- lib/lp/translations/publisher.py 1970-01-01 00:00:00 +0000
+++ lib/lp/translations/publisher.py 2010-07-22 20:59:01 +0000
@@ -0,0 +1,42 @@
1# Copyright 2010 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).
3
4"""Translations's custom publication."""
5
6__metaclass__ = type
7__all__ = [
8 'TranslationsBrowserRequest',
9 'TranslationsLayer',
10 'translations_request_publication_factory',
11 ]
12
13
14from zope.interface import implements
15from zope.publisher.interfaces.browser import (
16 IBrowserRequest, IDefaultBrowserLayer)
17
18from canonical.launchpad.webapp.publication import LaunchpadBrowserPublication
19from canonical.launchpad.webapp.servers import (
20 LaunchpadBrowserRequest, VHostWebServiceRequestPublicationFactory)
21
22
23class TranslationsLayer(IBrowserRequest, IDefaultBrowserLayer):
24 """The Translations layer."""
25
26
27class TranslationsBrowserRequest(LaunchpadBrowserRequest):
28 """Instances of TranslationsBrowserRequest provide `TranslationsLayer`."""
29 implements(TranslationsLayer)
30
31 def __init__(self, body_instream, environ, response=None):
32 super(TranslationsBrowserRequest, self).__init__(
33 body_instream, environ, response)
34 # Many of the responses from Translations vary based on language.
35 self.response.setHeader(
36 'Vary', 'Cookie, Authorization, Accept-Language')
37
38
39def translations_request_publication_factory():
40 return VHostWebServiceRequestPublicationFactory(
41 'translations', TranslationsBrowserRequest,
42 LaunchpadBrowserPublication)
043
=== added file 'lib/lp/translations/tests/test_publisher.py'
--- lib/lp/translations/tests/test_publisher.py 1970-01-01 00:00:00 +0000
+++ lib/lp/translations/tests/test_publisher.py 2010-07-22 20:59:01 +0000
@@ -0,0 +1,50 @@
1# Copyright 2010 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).
3
4"""Tests for translations's custom publications."""
5
6__metaclass__ = type
7
8import StringIO
9
10from canonical.config import config
11from canonical.launchpad.layers import WebServiceLayer
12from canonical.testing.layers import FunctionalLayer
13
14from lp.testing import TestCase
15from lp.testing.publication import get_request_and_publication
16
17from lp.translations.publisher import (
18 TranslationsLayer, TranslationsBrowserRequest)
19
20
21class TestRegistration(TestCase):
22 """Translations's publication customizations are installed correctly."""
23
24 layer = FunctionalLayer
25
26 def test_translations_request_provides_translations_layer(self):
27 # The request constructed for requests to the translations hostname
28 # provides TranslationsLayer.
29 request, publication = get_request_and_publication(
30 host=config.vhost.translations.hostname)
31 self.assertProvides(request, TranslationsLayer)
32
33 def test_translations_host_has_api(self):
34 # Requests to /api on the translations domain are treated as web
35 # service requests.
36 request, publication = get_request_and_publication(
37 host=config.vhost.translations.hostname,
38 extra_environment={'PATH_INFO': '/api/1.0'})
39 # XXX MichaelHudson, 2010-07-20, bug=607664: WebServiceLayer only
40 # actually provides WebServiceLayer in the sense of verifyObject after
41 # traversal has started.
42 self.assertTrue(WebServiceLayer.providedBy(request))
43
44 def test_response_should_vary_based_on_language(self):
45 # Responses to requests to translations pages have the 'Vary' header
46 # set to include Accept-Language.
47 request = TranslationsBrowserRequest(StringIO.StringIO(''), {})
48 self.assertEquals(
49 request.response.getHeader('Vary'),
50 'Cookie, Authorization, Accept-Language')