Merge lp:~mwhudson/launchpad/remove-unnecessary-ILaunchpadPublicationDirective into lp:launchpad

Proposed by Michael Hudson-Doyle
Status: Merged
Approved by: Robert Collins
Approved revision: no longer in the source branch.
Merged at revision: 11202
Proposed branch: lp:~mwhudson/launchpad/remove-unnecessary-ILaunchpadPublicationDirective
Merge into: lp:launchpad
Diff against target: 52 lines (+5/-7)
2 files modified
lib/canonical/launchpad/webapp/meta.zcml (+1/-1)
lib/canonical/launchpad/webapp/metazcml.py (+4/-6)
To merge this branch: bzr merge lp:~mwhudson/launchpad/remove-unnecessary-ILaunchpadPublicationDirective
Reviewer Review Type Date Requested Status
Robert Collins (community) Approve
Review via email: mp+30602@code.launchpad.net

Description of the change

Hi,

William pointed out that an interface definition I added wasn't necessary (priority is optional in the superclass and anyway I'd misspelled priority in my interface...).

So let's remove it again.

To post a comment you must log in.
Revision history for this message
Robert Collins (lifeless) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/canonical/launchpad/webapp/meta.zcml'
2--- lib/canonical/launchpad/webapp/meta.zcml 2010-07-16 15:13:50 +0000
3+++ lib/canonical/launchpad/webapp/meta.zcml 2010-07-22 02:24:53 +0000
4@@ -72,7 +72,7 @@
5 <directive
6 namespace="http://namespaces.zope.org/zope"
7 name="publisher"
8- schema="canonical.launchpad.webapp.metazcml.ILaunchpadPublicationDirective"
9+ schema="zope.app.publication.metadirectives.IRequestPublicationDirective"
10 handler="canonical.launchpad.webapp.metazcml.launchpadPublisher"
11 />
12
13
14=== modified file 'lib/canonical/launchpad/webapp/metazcml.py'
15--- lib/canonical/launchpad/webapp/metazcml.py 2010-07-16 15:35:45 +0000
16+++ lib/canonical/launchpad/webapp/metazcml.py 2010-07-22 02:24:53 +0000
17@@ -11,7 +11,6 @@
18 from zope.app.file.image import Image
19 from zope.app.pagetemplate.engine import TrustedEngine
20 from zope.app.publication.metaconfigure import publisher
21-from zope.app.publication.metadirectives import IRequestPublicationDirective
22 from zope.component import getUtility
23 from zope.component.security import PublicPermission
24 from zope.component.zcml import adapter, handler, utility, view
25@@ -21,7 +20,7 @@
26 from zope.publisher.interfaces.browser import (
27 IBrowserPublisher, IBrowserRequest, IDefaultBrowserLayer)
28 from zope.publisher.interfaces.xmlrpc import IXMLRPCRequest
29-from zope.schema import Int, TextLine
30+from zope.schema import TextLine
31 from zope.security.checker import Checker, CheckerPublic
32 from zope.security.interfaces import IPermission
33 from zope.security.permission import Permission
34@@ -656,15 +655,14 @@
35 utility(_context, ILaunchpadPermission, permission, name=id)
36
37
38-class ILaunchpadPublicationDirective(IRequestPublicationDirective):
39-
40- priorty = Int(required=False)
41-
42 _arbitrary_priority = 12
43
44
45 def launchpadPublisher(_context, name, factory, methods=['*'],
46 mimetypes=['*'], priority=None):
47+ # This overrides zope's definition of the <publisher> directive to supply
48+ # an arbitrary unique priority if none is explicitly supplied -- we don't
49+ # care about the priority in Launchpad but it needs to be unique.
50 global _arbitrary_priority
51 if priority is None:
52 _arbitrary_priority += 1