[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/publisher/browser/__init__.py Use my original code again. The tests prove that it behaves correctly.

Stephan Richter srichter at cosmos.phy.tufts.edu
Fri Sep 24 08:35:38 EDT 2004


Log message for revision 27672:
  Use my original code again. The tests prove that it behaves correctly.
  


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


-=-
Modified: Zope3/trunk/src/zope/app/publisher/browser/__init__.py
===================================================================
--- Zope3/trunk/src/zope/app/publisher/browser/__init__.py	2004-09-24 10:20:07 UTC (rev 27671)
+++ Zope3/trunk/src/zope/app/publisher/browser/__init__.py	2004-09-24 12:35:38 UTC (rev 27672)
@@ -55,10 +55,10 @@
     [<InterfaceClass zope.app.publisher.browser.SkinB>,
      <InterfaceClass zope.app.publisher.browser.IRequest>]
     """
-    old_skins = [iface for iface in directlyProvidedBy(request)
-                 if ISkin.providedBy(iface)]
-
-    for old_skin in old_skins:
-        directlyProvides(request, directlyProvidedBy(request) - old_skin)
-
-    directlyProvides(request, skin)
+    # Remove all existing skin declarations (commonly the default skin).
+    ifaces = [iface
+              for iface in directlyProvidedBy(request)
+              if not ISkin.providedBy(iface)]
+    # Add the new skin.
+    ifaces.append(skin)
+    directlyProvides(request, *ifaces)



More information about the Zope3-Checkins mailing list