← Back to team overview

launchpad-reviewers team mailing list archive

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

 

Michael Hudson has proposed merging lp:~mwhudson/launchpad/remove-unnecessary-ILaunchpadPublicationDirective into lp:launchpad/devel.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)


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.


-- 
https://code.launchpad.net/~mwhudson/launchpad/remove-unnecessary-ILaunchpadPublicationDirective/+merge/30602
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~mwhudson/launchpad/remove-unnecessary-ILaunchpadPublicationDirective into lp:launchpad/devel.
=== 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 02:24:53 +0000
@@ -72,7 +72,7 @@
   <directive
       namespace="http://namespaces.zope.org/zope";
       name="publisher"
-      schema="canonical.launchpad.webapp.metazcml.ILaunchpadPublicationDirective"
+      schema="zope.app.publication.metadirectives.IRequestPublicationDirective"
       handler="canonical.launchpad.webapp.metazcml.launchpadPublisher"
       />
 

=== 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 02:24:53 +0000
@@ -11,7 +11,6 @@
 from zope.app.file.image import Image
 from zope.app.pagetemplate.engine import TrustedEngine
 from zope.app.publication.metaconfigure import publisher
-from zope.app.publication.metadirectives import IRequestPublicationDirective
 from zope.component import getUtility
 from zope.component.security import PublicPermission
 from zope.component.zcml import adapter, handler, utility, view
@@ -21,7 +20,7 @@
 from zope.publisher.interfaces.browser import (
     IBrowserPublisher, IBrowserRequest, IDefaultBrowserLayer)
 from zope.publisher.interfaces.xmlrpc import IXMLRPCRequest
-from zope.schema import Int, TextLine
+from zope.schema import TextLine
 from zope.security.checker import Checker, CheckerPublic
 from zope.security.interfaces import IPermission
 from zope.security.permission import Permission
@@ -656,15 +655,14 @@
     utility(_context, ILaunchpadPermission, permission, name=id)
 
 
-class ILaunchpadPublicationDirective(IRequestPublicationDirective):
-
-    priorty = Int(required=False)
-
 _arbitrary_priority = 12
 
 
 def launchpadPublisher(_context, name, factory, methods=['*'],
                        mimetypes=['*'], priority=None):
+    # This overrides zope's definition of the <publisher> directive to supply
+    # an arbitrary unique priority if none is explicitly supplied -- we don't
+    # care about the priority in Launchpad but it needs to be unique.
     global _arbitrary_priority
     if priority is None:
         _arbitrary_priority += 1