[Erp5-report] r38116 yo - /erp5/trunk/products/ERP5Type/Tool/WebServiceTool.py

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Sep 2 08:17:00 CEST 2010


Author: yo
Date: Thu Sep  2 08:16:58 2010
New Revision: 38116

URL: http://svn.erp5.org?rev=38116&view=rev
Log:
Add an optional parameter ignore_duplicate into registerConnectionPlugin. This is useful for writing tests.

Modified:
    erp5/trunk/products/ERP5Type/Tool/WebServiceTool.py

Modified: erp5/trunk/products/ERP5Type/Tool/WebServiceTool.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/Tool/WebServiceTool.py?rev=38116&r1=38115&r2=38116&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/Tool/WebServiceTool.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/Tool/WebServiceTool.py [utf8] Thu Sep  2 08:16:58 2010
@@ -37,8 +37,10 @@ from Products.ERP5Type import _dtmldir
 
 connection_plugin_registry = {}
 
-def registerConnectionPlugin(name, klass):
-  assert name not in connection_plugin_registry, (name, connection_plugin_registry)
+def registerConnectionPlugin(name, klass, ignore_duplicate=False):
+  if not ignore_duplicate:
+    if name not in connection_plugin_registry:
+      raise ValueError('The connection plugin %r has already been registered in the registry %r' % (name, connection_plugin_registry))
   connection_plugin_registry[name] = klass
 
 # Import and register known connection plugins




More information about the Erp5-report mailing list