[Checkins] SVN: megrok.responseheaders/trunk/megrok/responseheaders/headers.py Remove magic (explicitly construct a dict rather than getting all local variables

Philipp von Weitershausen philikon at philikon.de
Wed Jun 4 09:29:56 EDT 2008


Log message for revision 87143:
  Remove magic (explicitly construct a dict rather than getting all local variables
  and messign with that).
  

Changed:
  U   megrok.responseheaders/trunk/megrok/responseheaders/headers.py

-=-
Modified: megrok.responseheaders/trunk/megrok/responseheaders/headers.py
===================================================================
--- megrok.responseheaders/trunk/megrok/responseheaders/headers.py	2008-06-04 13:27:22 UTC (rev 87142)
+++ megrok.responseheaders/trunk/megrok/responseheaders/headers.py	2008-06-04 13:29:56 UTC (rev 87143)
@@ -39,12 +39,10 @@
     def factory(self, seconds=0, minutes=0, hours=0,
                 days=0, years=0, private=False):
         """ return a dictionary containing all the valid parameters """
-        parameters = locals()
-        parameters.pop('self')
-        
-        return parameters
-        
+        return dict(seconds=seconds, minutes=minutes, hours=hours, days=days,
+                    years=years, private=private)        
 
+
 @grok.subscribe(grok.View, IBeforeTraverseEvent)
 def handle(view, event):
     cache_control = http_cache_control.bind().get(view) # None or {'days'...}



More information about the Checkins mailing list