[Zope3-checkins] SVN: Zope3/trunk/src/zope/publisher/ Added `__provides__` slot, so that we can directly-provide interfaces.

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


Log message for revision 27598:
  
  Added `__provides__` slot, so that we can directly-provide interfaces.
  
  


Changed:
  U   Zope3/trunk/src/zope/publisher/browser.py
  U   Zope3/trunk/src/zope/publisher/http.py


-=-
Modified: Zope3/trunk/src/zope/publisher/browser.py
===================================================================
--- Zope3/trunk/src/zope/publisher/browser.py	2004-09-17 16:16:37 UTC (rev 27597)
+++ Zope3/trunk/src/zope/publisher/browser.py	2004-09-17 16:16:40 UTC (rev 27598)
@@ -24,7 +24,7 @@
 from types import ListType, TupleType, StringType, StringTypes
 from cgi import FieldStorage, escape
 
-from zope.interface import implements
+from zope.interface import implements, directlyProvides
 from zope.i18n.interfaces import IUserPreferredLanguages
 from zope.i18n.interfaces import IUserPreferredCharsets
 from zope.publisher.interfaces.browser import IBrowserRequest
@@ -201,6 +201,7 @@
     implements(IBrowserRequest, IBrowserApplicationRequest)
 
     __slots__ = (
+        '__provides__',      # Allow request to directly provide interfaces
         'form',   # Form data
         'charsets', # helper attribute
         '__meth',
@@ -595,7 +596,7 @@
 
     def __init__(self,
                  body_instream=None, outstream=None, environ=None, form=None,
-                 skin='default',
+                 skin=None,
                  **kw):
 
         _testEnv =  {
@@ -621,7 +622,8 @@
         if form:
             self.form.update(form)
 
-        self.setPresentationSkin(skin)
+        if skin is not None:
+            directlyProvides(self, skin)
 
     def setPrincipal(self, principal):
         # HTTPRequest needs to notify the HTTPTask of the username.

Modified: Zope3/trunk/src/zope/publisher/http.py
===================================================================
--- Zope3/trunk/src/zope/publisher/http.py	2004-09-17 16:16:37 UTC (rev 27597)
+++ Zope3/trunk/src/zope/publisher/http.py	2004-09-17 16:16:40 UTC (rev 27598)
@@ -216,6 +216,7 @@
     implements(IHTTPCredentials, IHTTPRequest, IHTTPApplicationRequest)
 
     __slots__ = (
+        '__provides__',   # Allow request to directly provide interfaces
         '_auth',          # The value of the HTTP_AUTHORIZATION header.
         '_cookies',       # The request cookies
         '_path_suffix',   # Extra traversal steps after normal traversal



More information about the Zope3-Checkins mailing list