[Checkins] SVN: hurry.zoperesource/branches/janjaapdriessen-wsgi/src/hurry/zoperesource/z Register a factory for every library.

Jan-Jaap Driessen jdriessen at thehealthagency.com
Wed Nov 24 08:54:15 EST 2010


Log message for revision 118558:
  Register a factory for every library.

Changed:
  U   hurry.zoperesource/branches/janjaapdriessen-wsgi/src/hurry/zoperesource/zcml.py
  U   hurry.zoperesource/branches/janjaapdriessen-wsgi/src/hurry/zoperesource/zopesupport.py

-=-
Modified: hurry.zoperesource/branches/janjaapdriessen-wsgi/src/hurry/zoperesource/zcml.py
===================================================================
--- hurry.zoperesource/branches/janjaapdriessen-wsgi/src/hurry/zoperesource/zcml.py	2010-11-24 13:53:32 UTC (rev 118557)
+++ hurry.zoperesource/branches/janjaapdriessen-wsgi/src/hurry/zoperesource/zcml.py	2010-11-24 13:54:15 UTC (rev 118558)
@@ -4,15 +4,18 @@
 import hurry.resource
 from hurry.zoperesource.zopesupport import HurryResource
 
+def create_factory(library):
+    def factory(request):
+        return HurryResource(request, library)
+    return factory
+
 def action_setup(_context):
     """Publish all hurry.resource library entry points as resources.
     """
     for library in hurry.resource.libraries():
-        def factory(request):
-            return HurryResource(request, library)
+        factory = create_factory(library)
         adapts = (IBrowserRequest,)
         provides = Interface
-
         _context.action(
             discriminator = ('adapter', adapts, provides, library.name),
             callable = component.provideAdapter,

Modified: hurry.zoperesource/branches/janjaapdriessen-wsgi/src/hurry/zoperesource/zopesupport.py
===================================================================
--- hurry.zoperesource/branches/janjaapdriessen-wsgi/src/hurry/zoperesource/zopesupport.py	2010-11-24 13:53:32 UTC (rev 118557)
+++ hurry.zoperesource/branches/janjaapdriessen-wsgi/src/hurry/zoperesource/zopesupport.py	2010-11-24 13:54:15 UTC (rev 118558)
@@ -17,7 +17,7 @@
 
     # Hack to get ++resource++foo/bar/baz.jpg paths working in Zope
     # Pagetemplates.
-    
+
     implements(ITraversable, IAbsoluteURL)
 
     def __init__(self, request, library, name=''):



More information about the checkins mailing list