[Checkins] SVN: hurry.resource/branches/janjaapdriessen-resource-publisher/src/hurry/resource/publisher.py take publisher_signature from local config

Jan-Wijbrand Kolman janwijbrand at gmail.com
Tue Nov 23 11:58:58 EST 2010


Log message for revision 118539:
  take publisher_signature from local config

Changed:
  U   hurry.resource/branches/janjaapdriessen-resource-publisher/src/hurry/resource/publisher.py

-=-
Modified: hurry.resource/branches/janjaapdriessen-resource-publisher/src/hurry/resource/publisher.py
===================================================================
--- hurry.resource/branches/janjaapdriessen-resource-publisher/src/hurry/resource/publisher.py	2010-11-23 16:30:24 UTC (rev 118538)
+++ hurry.resource/branches/janjaapdriessen-resource-publisher/src/hurry/resource/publisher.py	2010-11-23 16:58:57 UTC (rev 118539)
@@ -49,13 +49,14 @@
 
 class Delegator(object):
     
-    def __init__(self, app, signature):
+    def __init__(self, app, publisher_signature='fanstatic'):
         self.application = app
+        self.publisher_signature = publisher_signature
         self.resource_publisher = Publisher()
 
     def __call__(self, environ, start_response):
         path_info = environ['PATH_INFO']
-        trigger = '/%s/' % signature
+        trigger = '/%s/' % self.publisher_signature
         chunks = path_info.split(trigger, 1)
         if len(chunks) == 1:
             # The trigger is not in the URL at all, we delegate to the
@@ -66,14 +67,5 @@
         return self.resource_publisher(environ, start_response)
 
 def make_delegator(app, global_conf, **local_conf):
-    return Delegator(app, hurry.resource.publisher_signature)
+    return Delegator(app, **local_conf)
 
-"""
-        def cache_header_start_response(status, headers, exc_info=None):
-            # Only set the cache control for succesful requests (200, 206).
-            if status.startswith('20'):
-                expires = CACHE_CONTROL.apply(
-                    headers, max_age=10*CACHE_CONTROL.ONE_YEAR)
-                EXPIRES.update(headers, delta=expires)
-            return start_response(status, headers, exc_info)
-"""



More information about the checkins mailing list