[Checkins] SVN: PluginRegistry/trunk/ Added workaround for autogen factories which assume they can pass an ID to the registry's '__init__'.

Tres Seaver tseaver at palladion.com
Tue Jul 25 18:09:24 EDT 2006


Log message for revision 69261:
  Added workaround for autogen factories which assume they can pass an ID to the registry's '__init__'.
  
  This workaround allows the registry to be created and popluated as a "normal"
  content object using GenericSetup.
  

Changed:
  U   PluginRegistry/trunk/CHANGES.txt
  U   PluginRegistry/trunk/PluginRegistry.py
  U   PluginRegistry/trunk/version.txt

-=-
Modified: PluginRegistry/trunk/CHANGES.txt
===================================================================
--- PluginRegistry/trunk/CHANGES.txt	2006-07-25 20:40:54 UTC (rev 69260)
+++ PluginRegistry/trunk/CHANGES.txt	2006-07-25 22:09:23 UTC (rev 69261)
@@ -1,5 +1,14 @@
 PluginRegistry Product Changelog
 
+  After PluginRegistry 1.1 (2006/02/25)
+
+    - Added workaround for autogen factories which assume they can
+      pass an ID to the registry's '__init__'.  In particular, this
+      allows the registry to be created and popluated as a "normal"
+      content object using GenericSetup.
+
+    - Improved BBB for testing under Zope 2.8.
+
   PluginRegistry 1.1 (2006/02/25)
 
     - SVN tag:  svn+ssh://svn.zope.org/repos/main/PluginRegistry/tags/1.1

Modified: PluginRegistry/trunk/PluginRegistry.py
===================================================================
--- PluginRegistry/trunk/PluginRegistry.py	2006-07-25 20:40:54 UTC (rev 69260)
+++ PluginRegistry/trunk/PluginRegistry.py	2006-07-25 22:09:23 UTC (rev 69261)
@@ -78,8 +78,12 @@
 
     _plugins = None
 
-    def __init__( self, plugin_type_info ):
+    def __init__( self, plugin_type_info=() ):
 
+        if isinstance(plugin_type_info, basestring):
+            # some tool is passing us our ID.
+            raise ValueError('Must pass a sequence of plugin info dicts!')
+
         self._plugin_types = [x[0] for x in plugin_type_info]
         self._plugin_type_info = PersistentMapping()
         for interface in plugin_type_info:

Modified: PluginRegistry/trunk/version.txt
===================================================================
--- PluginRegistry/trunk/version.txt	2006-07-25 20:40:54 UTC (rev 69260)
+++ PluginRegistry/trunk/version.txt	2006-07-25 22:09:23 UTC (rev 69261)
@@ -1 +1 @@
-1.1
+1.1+



More information about the Checkins mailing list