[Zope3-checkins] SVN: Zope3/branches/jim-adapter/src/zope/ More on MakeZopeAppSmaller:

Philipp von Weitershausen philikon at philikon.de
Thu Apr 6 11:51:09 EDT 2006


Log message for revision 66591:
  More on MakeZopeAppSmaller:
  * Move BrowserView to zope.publisher.browser
  

Changed:
  U   Zope3/branches/jim-adapter/src/zope/app/publisher/browser/__init__.py
  U   Zope3/branches/jim-adapter/src/zope/app/publisher/interfaces/browser.py
  U   Zope3/branches/jim-adapter/src/zope/publisher/DEPENDENCIES.cfg
  U   Zope3/branches/jim-adapter/src/zope/publisher/browser.py
  U   Zope3/branches/jim-adapter/src/zope/publisher/interfaces/browser.py

-=-
Modified: Zope3/branches/jim-adapter/src/zope/app/publisher/browser/__init__.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/publisher/browser/__init__.py	2006-04-06 12:18:25 UTC (rev 66590)
+++ Zope3/branches/jim-adapter/src/zope/app/publisher/browser/__init__.py	2006-04-06 15:51:09 UTC (rev 66591)
@@ -23,56 +23,21 @@
 from zope.publisher.browser import BrowserLanguages
 from zope.i18n.interfaces import IUserPreferredLanguages
 from zope.i18n.interfaces import IModifiableUserPreferredLanguages
-from zope.location import Location
 
-from zope.app.publisher.interfaces.browser import IBrowserView
-
-key = "zope.app.publisher.browser.IUserPreferredLanguages"
-
 ##############################################################################
 # BBB 2006/04/03 - to be removed after 12 months
 
 import zope.deferredimport
 zope.deferredimport.deprecated(
-    "applySkin has been moved to zope.publisher.browser. This "
-    "reference will be removed in Zope 3.5.",
+    "It has been moved to zope.publisher.browser. This reference will "
+    "be removed in Zope 3.5.",
+    BrowserView = 'zope.publisher.browser:BrowserView',
     applySkin = 'zope.publisher.browser:applySkin',
     )
 
 #
 ##############################################################################
 
-class BrowserView(Location):
-    """Browser View.
-
-    >>> view = BrowserView("context", "request")
-    >>> view.context
-    'context'
-    >>> view.request
-    'request'
-
-    >>> view.__parent__
-    'context'
-    >>> view.__parent__ = "parent"
-    >>> view.__parent__
-    'parent'
-    """
-
-    implements(IBrowserView)
-
-    def __init__(self, context, request):
-        self.context = context
-        self.request = request
-
-    def __getParent(self):
-        return getattr(self, '_parent', self.context)
-
-    def __setParent(self, parent):
-        self._parent = parent
-
-    __parent__ = property(__getParent, __setParent)
-
-
 class IDefaultViewNameAPI(zope.interface.Interface):
 
     def getDefaultViewName(object, request, context=None):
@@ -117,6 +82,8 @@
        zope.i18n.interfaces.IModifiableBrowserLanguages has been used.
     """
 
+key = "zope.app.publisher.browser.IUserPreferredLanguages"
+
 class CacheableBrowserLanguages(BrowserLanguages):
 
     implements(IUserPreferredLanguages)

Modified: Zope3/branches/jim-adapter/src/zope/app/publisher/interfaces/browser.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/publisher/interfaces/browser.py	2006-04-06 12:18:25 UTC (rev 66590)
+++ Zope3/branches/jim-adapter/src/zope/app/publisher/interfaces/browser.py	2006-04-06 15:51:09 UTC (rev 66591)
@@ -15,16 +15,23 @@
 
 $Id$
 """
-from zope.component.interfaces import IView
 from zope.app.i18n import ZopeMessageFactory as _
 from zope.interface import Interface, directlyProvides
 from zope.interface.interfaces import IInterface
 from zope.schema import TextLine, Text, Choice, URI, Int, InterfaceField
 
+##############################################################################
+# BBB 2006/04/03 - to be removed after 12 months
 
-class IBrowserView(IView):
-    """Browser View"""
+import zope.deferredimport
+zope.deferredimport.deprecated(
+    "IBrowserView has been moved to zope.publisher.interfaces.browser. "
+    "This reference will be removed in Zope 3.5.",
+    IBrowserView = 'zope.publisher.interfaces.browser:IBrowserView',
+    )
 
+#
+##############################################################################
 
 class IMenuItemType(IInterface):
     """Menu item type

Modified: Zope3/branches/jim-adapter/src/zope/publisher/DEPENDENCIES.cfg
===================================================================
--- Zope3/branches/jim-adapter/src/zope/publisher/DEPENDENCIES.cfg	2006-04-06 12:18:25 UTC (rev 66590)
+++ Zope3/branches/jim-adapter/src/zope/publisher/DEPENDENCIES.cfg	2006-04-06 15:51:09 UTC (rev 66591)
@@ -2,6 +2,7 @@
 zope.exceptions
 zope.i18n
 zope.interface
+zope.location
 zope.proxy
 zope.security
 zope.testing

Modified: Zope3/branches/jim-adapter/src/zope/publisher/browser.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/publisher/browser.py	2006-04-06 12:18:25 UTC (rev 66590)
+++ Zope3/branches/jim-adapter/src/zope/publisher/browser.py	2006-04-06 15:51:09 UTC (rev 66591)
@@ -29,10 +29,13 @@
 from zope.interface import directlyProvidedBy, providedBy
 from zope.i18n.interfaces import IUserPreferredLanguages
 from zope.i18n.interfaces import IUserPreferredCharsets
+from zope.location import Location
+
 from zope.publisher.interfaces.browser import IBrowserRequest
 from zope.publisher.interfaces.browser import IDefaultBrowserLayer
 from zope.publisher.interfaces.browser import IDefaultSkin
 from zope.publisher.interfaces.browser import IBrowserApplicationRequest
+from zope.publisher.interfaces.browser import IBrowserView
 from zope.publisher.interfaces.browser import IBrowserSkinType
 from zope.publisher.http import HTTPRequest, HTTPResponse
 
@@ -824,6 +827,35 @@
 
         return [lang for quality, lang in accepts]
 
+class BrowserView(Location):
+    """Browser View.
+
+    >>> view = BrowserView("context", "request")
+    >>> view.context
+    'context'
+    >>> view.request
+    'request'
+
+    >>> view.__parent__
+    'context'
+    >>> view.__parent__ = "parent"
+    >>> view.__parent__
+    'parent'
+    """
+    implements(IBrowserView)
+
+    def __init__(self, context, request):
+        self.context = context
+        self.request = request
+
+    def __getParent(self):
+        return getattr(self, '_parent', self.context)
+
+    def __setParent(self, parent):
+        self._parent = parent
+
+    __parent__ = property(__getParent, __setParent)
+
 def setDefaultSkin(request):
     """Sets the default skin for the request.
 

Modified: Zope3/branches/jim-adapter/src/zope/publisher/interfaces/browser.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/publisher/interfaces/browser.py	2006-04-06 12:18:25 UTC (rev 66590)
+++ Zope3/branches/jim-adapter/src/zope/publisher/interfaces/browser.py	2006-04-06 15:51:09 UTC (rev 66591)
@@ -20,13 +20,13 @@
 
 from zope.interface import Interface, Attribute, directlyProvides
 from zope.interface.interfaces import IInterface
+from zope.component.interfaces import IView
 
 from zope.publisher.interfaces import IPublication
 from zope.publisher.interfaces import IPublishTraverse
 from zope.publisher.interfaces.http import IHTTPApplicationRequest
 from zope.publisher.interfaces.http import IHTTPRequest
 
-
 class IBrowserApplicationRequest(IHTTPApplicationRequest):
     """Browser-specific requests
     """
@@ -107,6 +107,9 @@
         """
 
 
+class IBrowserView(IView):
+    """Browser View"""
+
 class IDefaultBrowserLayer(IBrowserRequest):
     """The default layer."""
 



More information about the Zope3-Checkins mailing list