[Zope3-checkins] SVN: Zope3/trunk/src/zope/publisher/ Remove `setPresentationSkin()` and `getPresentationSkin()` methods from

Stephan Richter srichter at cosmos.phy.tufts.edu
Fri Sep 17 12:16:30 EDT 2004


Log message for revision 27593:
  
  Remove `setPresentationSkin()` and `getPresentationSkin()` methods from
  request.
  
  


Changed:
  U   Zope3/trunk/src/zope/publisher/base.py
  U   Zope3/trunk/src/zope/publisher/interfaces/__init__.py
  U   Zope3/trunk/src/zope/publisher/tests/test_browserrequest.py
  U   Zope3/trunk/src/zope/publisher/tests/test_http.py


-=-
Modified: Zope3/trunk/src/zope/publisher/base.py
===================================================================
--- Zope3/trunk/src/zope/publisher/base.py	2004-09-17 16:16:22 UTC (rev 27592)
+++ Zope3/trunk/src/zope/publisher/base.py	2004-09-17 16:16:30 UTC (rev 27593)
@@ -21,7 +21,7 @@
 import traceback
 from cStringIO import StringIO
 
-from zope.interface import implements
+from zope.interface import implements, providedBy
 from zope.interface.common.mapping import IReadMapping, IEnumerableMapping
 from zope.exceptions import NotFoundError
 
@@ -178,6 +178,7 @@
     implements(IRequest)
 
     __slots__ = (
+        '__provides__',      # Allow request to directly provide interfaces
         '_held',             # Objects held until the request is closed
         '_traversed_names',  # The names that have been traversed
         '_last_obj_traversed', # Object that was traversed last
@@ -188,7 +189,6 @@
         '_body_instream',    # input stream
         '_body',             # The request body as a string
         '_publication',      # publication object
-        '_presentation_skin', # View skin
         '_principal',        # request principal, set by publication
         'interaction',       # interaction, set by interaction
         'debug',             # debug flags
@@ -304,14 +304,6 @@
         'See IPublicationRequest'
         self._traversal_stack[:] = list(stack)
 
-    def setPresentationSkin(self, skin):
-        'See IPublicationRequest'
-        self._presentation_skin = skin
-
-    def getPresentationSkin(self):
-        'See IPresentationRequest'
-        return getattr(self, '_presentation_skin', '')
-
     def _getBody(self):
         body = getattr(self, '_body', None)
         if body is None:

Modified: Zope3/trunk/src/zope/publisher/interfaces/__init__.py
===================================================================
--- Zope3/trunk/src/zope/publisher/interfaces/__init__.py	2004-09-17 16:16:22 UTC (rev 27592)
+++ Zope3/trunk/src/zope/publisher/interfaces/__init__.py	2004-09-17 16:16:30 UTC (rev 27593)
@@ -170,7 +170,6 @@
         The request must be an IPublisherRequest.
         """
 
-
 class IPublisherResponse(Interface):
     """Interface used by the publsher
     """
@@ -318,12 +317,6 @@
         """Return the positional arguments given to the request.
         """
 
-    def setPresentationSkin(skin):
-        """Set the skin to be used for the request.
-
-        It's up to the publication object to decide this.
-        """
-
     def setPrincipal(principal):
         """Set the principal attribute.
 

Modified: Zope3/trunk/src/zope/publisher/tests/test_browserrequest.py
===================================================================
--- Zope3/trunk/src/zope/publisher/tests/test_browserrequest.py	2004-09-17 16:16:22 UTC (rev 27592)
+++ Zope3/trunk/src/zope/publisher/tests/test_browserrequest.py	2004-09-17 16:16:30 UTC (rev 27593)
@@ -17,14 +17,16 @@
 """
 import unittest
 
+from zope.interface import implements, directlyProvides, Interface
+from zope.interface.verify import verifyObject
+
 from zope.publisher.http import HTTPCharsets
 from zope.publisher.browser import BrowserRequest
 from zope.publisher.interfaces import NotFound
 
 from zope.publisher.base import DefaultPublication
 from zope.publisher.interfaces.browser import IBrowserApplicationRequest
-from zope.publisher.interfaces.browser import IBrowserRequest
-from zope.interface.verify import verifyObject
+from zope.publisher.interfaces.browser import IBrowserRequest, ISkin
 
 from StringIO import StringIO
 
@@ -132,14 +134,6 @@
             "\r\n"
             "u'5', 6")
 
-    def testIPresentationRequest(self):
-        # test the IView request
-        r = self._createRequest()
-
-        self.assertEqual(r.getPresentationSkin(), '')
-        r.setPresentationSkin('morefoo')
-        self.assertEqual(r.getPresentationSkin(), 'morefoo')
-
     def testNoDefault(self):
         request = self._createRequest()
         response = request.response

Modified: Zope3/trunk/src/zope/publisher/tests/test_http.py
===================================================================
--- Zope3/trunk/src/zope/publisher/tests/test_http.py	2004-09-17 16:16:22 UTC (rev 27592)
+++ Zope3/trunk/src/zope/publisher/tests/test_http.py	2004-09-17 16:16:30 UTC (rev 27593)
@@ -281,14 +281,6 @@
         req.setPrincipal(UserStub("jim"))
         self.assertEquals(req.response.http_transaction.auth_user_name, "jim")
 
-    def testIPresentationRequest(self):
-        # test the IView request
-        r = self._createRequest()
-
-        self.assertEqual(r.getPresentationSkin(), '')
-        r.setPresentationSkin('morefoo')
-        self.assertEqual(r.getPresentationSkin(), 'morefoo')
-
     def test_method(self):
         r = self._createRequest(extra_env={'REQUEST_METHOD':'SPAM'})
         self.assertEqual(r.method, 'SPAM')



More information about the Zope3-Checkins mailing list