[Checkins] SVN: z3c.jsonrpc/trunk/src/z3c/jsonrpc/namespace.py -
Bug: The skin code relied on un-released API that was actually later
Stephan Richter
srichter at cosmos.phy.tufts.edu
Thu Jan 24 17:46:42 EST 2008
Log message for revision 83191:
- Bug: The skin code relied on un-released API that was actually later
reverted.
Changed:
U z3c.jsonrpc/trunk/src/z3c/jsonrpc/namespace.py
-=-
Modified: z3c.jsonrpc/trunk/src/z3c/jsonrpc/namespace.py
===================================================================
--- z3c.jsonrpc/trunk/src/z3c/jsonrpc/namespace.py 2008-01-24 20:02:41 UTC (rev 83190)
+++ z3c.jsonrpc/trunk/src/z3c/jsonrpc/namespace.py 2008-01-24 22:46:42 UTC (rev 83191)
@@ -1,14 +1,22 @@
-# Make a package.
-
import zope.component
+import zope.interface
import zope.traversing.namespace
from zope.component.interfaces import ComponentLookupError
-from zope.publisher.http import applySkin
from zope.traversing.interfaces import TraversalError
from z3c.jsonrpc import interfaces
+def applySkin(request, skin, skin_type):
+ """Change the presentation skin for this request."""
+ # Remove all existing skin declarations (commonly the default skin).
+ ifaces = [iface for iface in zope.interface.directlyProvidedBy(request)
+ if not skin_type.providedBy(iface)]
+ # Add the new skin.
+ ifaces.append(skin)
+ zope.interface.directlyProvides(request, *ifaces)
+
+
class skin(zope.traversing.namespace.skin):
"""JSONRPC skin type interface."""
More information about the Checkins
mailing list