[Checkins] SVN: zc.sourcefactory/branches/aaron-flexible-contextual-source-binder/ Make FactoredSourceBinderMore flexible.

Aaron Lehmann aaron at zope.com
Tue Jan 27 10:18:00 EST 2009


Log message for revision 95218:
  Make FactoredSourceBinderMore flexible.
  
  

Changed:
  U   zc.sourcefactory/branches/aaron-flexible-contextual-source-binder/CHANGES.txt
  U   zc.sourcefactory/branches/aaron-flexible-contextual-source-binder/src/zc/sourcefactory/factories.py

-=-
Modified: zc.sourcefactory/branches/aaron-flexible-contextual-source-binder/CHANGES.txt
===================================================================
--- zc.sourcefactory/branches/aaron-flexible-contextual-source-binder/CHANGES.txt	2009-01-27 15:10:28 UTC (rev 95217)
+++ zc.sourcefactory/branches/aaron-flexible-contextual-source-binder/CHANGES.txt	2009-01-27 15:17:59 UTC (rev 95218)
@@ -5,7 +5,8 @@
 0.4.1 (unreleased)
 ==================
 
-    - 
+    - FactoredContextualSourceBinder.__call__ now accepts arguments giving the
+      class of source to make, and args to pass to source class.
 
 
 0.4.0 (2008-12-11)

Modified: zc.sourcefactory/branches/aaron-flexible-contextual-source-binder/src/zc/sourcefactory/factories.py
===================================================================
--- zc.sourcefactory/branches/aaron-flexible-contextual-source-binder/src/zc/sourcefactory/factories.py	2009-01-27 15:10:28 UTC (rev 95217)
+++ zc.sourcefactory/branches/aaron-flexible-contextual-source-binder/src/zc/sourcefactory/factories.py	2009-01-27 15:17:59 UTC (rev 95218)
@@ -60,6 +60,7 @@
     def __init__(self, factory):
         self.factory = factory
 
-    def __call__(self, context):
-        return zc.sourcefactory.source.FactoredContextualSource(
-            self.factory, context)
+    def __call__(self, context, source_class=None, *args, **kwargs):
+        source_class = (source_class or
+            zc.sourcefactory.source.FactoredContextualSource)
+        return source_class(self.factory, context, *args, **kwargs)



More information about the Checkins mailing list