[Checkins] SVN: zope.app.publisher/trunk/ Use new location for ZPT engine.

Tres Seaver tseaver at palladion.com
Mon May 25 15:31:23 EDT 2009


Log message for revision 100372:
  Use new location for ZPT engine.

Changed:
  U   zope.app.publisher/trunk/CHANGES.txt
  U   zope.app.publisher/trunk/setup.py
  U   zope.app.publisher/trunk/src/zope/app/publisher/browser/menu.py
  U   zope.app.publisher/trunk/src/zope/app/publisher/browser/menumeta.py
  U   zope.app.publisher/trunk/src/zope/app/publisher/pagetemplateresource.py

-=-
Modified: zope.app.publisher/trunk/CHANGES.txt
===================================================================
--- zope.app.publisher/trunk/CHANGES.txt	2009-05-25 19:16:17 UTC (rev 100371)
+++ zope.app.publisher/trunk/CHANGES.txt	2009-05-25 19:31:23 UTC (rev 100372)
@@ -5,6 +5,9 @@
 3.8.1 (unreleased)
 ==================
 
+- Updated to use ``zope.pagetemplate.engine`` module (requires versino
+  3.5.0 or later), instead of ``zope.app.pagetemplate`` precursor.
+
 - Replaced zope.deprecation dependency with BBB imports
 
 3.8.0 (2009-05-23)

Modified: zope.app.publisher/trunk/setup.py
===================================================================
--- zope.app.publisher/trunk/setup.py	2009-05-25 19:16:17 UTC (rev 100371)
+++ zope.app.publisher/trunk/setup.py	2009-05-25 19:31:23 UTC (rev 100372)
@@ -50,7 +50,7 @@
                         'zope.i18n',
                         'zope.interface',
                         'zope.location',
-                        'zope.pagetemplate',
+                        'zope.pagetemplate>=3.5.0',
                         'zope.publisher>=3.8.0',
                         'zope.schema',
                         'zope.site',

Modified: zope.app.publisher/trunk/src/zope/app/publisher/browser/menu.py
===================================================================
--- zope.app.publisher/trunk/src/zope/app/publisher/browser/menu.py	2009-05-25 19:16:17 UTC (rev 100371)
+++ zope.app.publisher/trunk/src/zope/app/publisher/browser/menu.py	2009-05-25 19:31:23 UTC (rev 100372)
@@ -18,16 +18,21 @@
 __docformat__ = "reStructuredText"
 import sys
 
-import zope.component
-import zope.interface.interfaces
-from zope.interface import Interface, implements, providedBy
-from zope.security import checkPermission, canAccess
-from zope.security.interfaces import Unauthorized, Forbidden
+from zope.component import getAdapters
+from zope.component import getUtility
+from zope.interface import Interface
+from zope.interface import implements
+from zope.interface import providedBy
+from zope.interface.interfaces import IInterface
+from zope.pagetemplate.engine import Engine
+from zope.publisher.browser import BrowserView
+from zope.security import canAccess
+from zope.security import checkPermission
+from zope.security.interfaces import Forbidden
+from zope.security.interfaces import Unauthorized
 from zope.security.proxy import removeSecurityProxy
-from zope.publisher.browser import BrowserView
 from zope.traversing.publicationtraverse import PublicationTraverser
 
-from zope.app.pagetemplate.engine import Engine
 from zope.app.publisher.interfaces.browser import IMenuAccessView
 from zope.app.publisher.interfaces.browser import IBrowserMenu
 from zope.app.publisher.interfaces.browser import IBrowserMenuItem
@@ -44,14 +49,14 @@
         self.description = description
 
     def getMenuItemType(self):
-        return zope.component.getUtility(IMenuItemType, self.id)
+        return getUtility(IMenuItemType, self.id)
 
     def getMenuItems(self, object, request):
         """Return menu item entries in a TAL-friendly form."""
 
         result = []
-        for name, item in zope.component.getAdapters((object, request),
-                                                     self.getMenuItemType()):
+        for name, item in getAdapters((object, request),
+                                      self.getMenuItemType()):
             if item.available():
                 result.append(item)
 
@@ -66,7 +71,7 @@
             iface = item._for
             if not iface:
                 iface = Interface
-            if zope.interface.interfaces.IInterface.providedBy(iface):
+            if IInterface.providedBy(iface):
                 return ifaces.index(iface)
             if isinstance(removeSecurityProxy(object), item._for):
                 # directly specified for class, this goes first.
@@ -186,7 +191,7 @@
 
 def getMenu(id, object, request):
     """Return menu item entries in a TAL-friendly form."""
-    menu = zope.component.getUtility(IBrowserMenu, id)
+    menu = getUtility(IBrowserMenu, id)
     return menu.getMenuItems(object, request)
 
 

Modified: zope.app.publisher/trunk/src/zope/app/publisher/browser/menumeta.py
===================================================================
--- zope.app.publisher/trunk/src/zope/app/publisher/browser/menumeta.py	2009-05-25 19:16:17 UTC (rev 100371)
+++ zope.app.publisher/trunk/src/zope/app/publisher/browser/menumeta.py	2009-05-25 19:31:23 UTC (rev 100372)
@@ -15,18 +15,21 @@
 
 $Id$
 """
-import zope.component
+from zope.browser.interfaces import IAdding
+from zope.component import getGlobalSiteManager
+from zope.component import getUtility
+from zope.component.interface import provideInterface
+from zope.component.zcml import adapter
+from zope.component.zcml import proxify
+from zope.component.zcml import utility
 from zope.configuration.exceptions import ConfigurationError
 from zope.interface.interface import InterfaceClass
 from zope.interface import Interface
+from zope.pagetemplate.engine import Engine
 from zope.publisher.interfaces.browser import IDefaultBrowserLayer
 from zope.security.checker import InterfaceChecker, CheckerPublic
 from zope.security.metaconfigure import ClassDirective
-from zope.component.interface import provideInterface
-from zope.component.zcml import adapter, proxify, utility
 
-from zope.app.pagetemplate.engine import Engine
-from zope.browser.interfaces import IAdding
 from zope.app.publisher.browser.menu import BrowserMenu
 from zope.app.publisher.browser.menu import BrowserMenuItem, BrowserSubMenuItem
 from zope.app.publisher.interfaces.browser import IBrowserMenu
@@ -234,7 +237,7 @@
             " is optional but can\'t be empty"
             )
 
-    gsm = zope.component.getGlobalSiteManager()
+    gsm = getGlobalSiteManager()
     if gsm.adapters.lookup((for_, layer),
                            Interface, view_name) is None:
         raise ConfigurationError(
@@ -266,7 +269,7 @@
 
     if menu is not None:
         if isinstance(menu, (str, unicode)):
-            menu = zope.component.getUtility(IMenuItemType, menu)
+            menu = getUtility(IMenuItemType, menu)
             if menu is None:
                 raise ValueError("Missing menu id '%s'" % menu)
 

Modified: zope.app.publisher/trunk/src/zope/app/publisher/pagetemplateresource.py
===================================================================
--- zope.app.publisher/trunk/src/zope/app/publisher/pagetemplateresource.py	2009-05-25 19:16:17 UTC (rev 100371)
+++ zope.app.publisher/trunk/src/zope/app/publisher/pagetemplateresource.py	2009-05-25 19:31:23 UTC (rev 100372)
@@ -16,8 +16,8 @@
 $Id$
 """
 
+from zope.pagetemplate.engine import TrustedAppPT
 from zope.pagetemplate.pagetemplatefile import PageTemplateFile
-from zope.app.pagetemplate.engine import TrustedAppPT
 
 class PageTemplate(TrustedAppPT, PageTemplateFile):
     """



More information about the Checkins mailing list