[Checkins] SVN: zc.sourcefactory/trunk/ ``BasicSourceFactory`` now uses a class variable to tell what kind of source to make. (Same mechanism as it was added for ``ContextualSourceFactory`` in version 0.5.0).

Michael Howitz mh at gocept.com
Thu Sep 1 14:18:55 EST 2011


Log message for revision 122713:
  ``BasicSourceFactory`` now uses a class variable to tell what kind of source to make. (Same mechanism as it was added for ``ContextualSourceFactory`` in version 0.5.0).
  

Changed:
  U   zc.sourcefactory/trunk/CHANGES.txt
  U   zc.sourcefactory/trunk/src/zc/sourcefactory/factories.py

-=-
Modified: zc.sourcefactory/trunk/CHANGES.txt
===================================================================
--- zc.sourcefactory/trunk/CHANGES.txt	2011-08-31 13:01:04 UTC (rev 122712)
+++ zc.sourcefactory/trunk/CHANGES.txt	2011-09-01 19:18:54 UTC (rev 122713)
@@ -5,7 +5,9 @@
 0.7.1 (unreleased)
 ==================
 
-- Nothing changed yet.
+- ``BasicSourceFactory`` now uses a class variable to tell what kind of
+  source to make. (Same mechanism as it was added for
+  ``ContextualSourceFactory`` in version 0.5.0).
 
 
 0.7.0 (2010-09-17)

Modified: zc.sourcefactory/trunk/src/zc/sourcefactory/factories.py
===================================================================
--- zc.sourcefactory/trunk/src/zc/sourcefactory/factories.py	2011-08-31 13:01:04 UTC (rev 122712)
+++ zc.sourcefactory/trunk/src/zc/sourcefactory/factories.py	2011-09-01 19:18:54 UTC (rev 122713)
@@ -32,11 +32,13 @@
 
     zope.interface.implements(zc.sourcefactory.interfaces.ISourceFactory)
 
+    source_class = zc.sourcefactory.source.FactoredSource
+
     def __new__(cls, *args, **kw):
         """Create the factory object and return source."""
         factory = object.__new__(cls)
         factory.__init__(*args, **kw)
-        return zc.sourcefactory.source.FactoredSource(factory)
+        return cls.source_class(factory)
 
 
 class ContextualSourceFactory(BasicSourceFactory):



More information about the checkins mailing list