[Checkins] SVN: zc.sourcefactory/branches/aaron-flexible-contextual-source-binder/src/zc/sourcefactory/ Updated docs for fred's last change.

Aaron Lehmann aaron at zope.com
Tue Jan 27 11:53:37 EST 2009


Log message for revision 95224:
  Updated docs for fred's last change.
  
  

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

-=-
Modified: zc.sourcefactory/branches/aaron-flexible-contextual-source-binder/src/zc/sourcefactory/README.txt
===================================================================
--- zc.sourcefactory/branches/aaron-flexible-contextual-source-binder/src/zc/sourcefactory/README.txt	2009-01-27 16:46:15 UTC (rev 95223)
+++ zc.sourcefactory/branches/aaron-flexible-contextual-source-binder/src/zc/sourcefactory/README.txt	2009-01-27 16:53:36 UTC (rev 95224)
@@ -99,7 +99,10 @@
   ...     def _get_filtered_values(self):
   ...         for value in self.factory.getValues(self.context):
   ...             yield self.multiplier * value
-  >>> source = binder(context, source_class=MultiplierSource, multiplier=5)
+  >>> class MultiplierSourceFactory(MyDynamicSource):
+  ...     source_class = MultiplierSource
+  >>> binder = MultiplierSourceFactory()
+  >>> source = binder(context, multiplier=5)
   >>> list(source)
   [5, 10, 15, 20]
   >>> 5 in source

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 16:46:15 UTC (rev 95223)
+++ zc.sourcefactory/branches/aaron-flexible-contextual-source-binder/src/zc/sourcefactory/factories.py	2009-01-27 16:53:36 UTC (rev 95224)
@@ -51,7 +51,7 @@
         """Create the factory object and return source."""
         factory = object.__new__(cls)
         factory.__init__(*args, **kw)
-        return FactoredContextualSourceBinder(factory, self.source_class)
+        return FactoredContextualSourceBinder(factory, cls.source_class)
 
 
 class FactoredContextualSourceBinder(object):



More information about the Checkins mailing list