[Erp5-report] r14281 - /erp5/trunk/products/ERP5SyncML/XMLSyncUtils.py

nobody at svn.erp5.org nobody at svn.erp5.org
Mon Apr 30 17:25:14 CEST 2007


Author: seb
Date: Mon Apr 30 17:25:13 2007
New Revision: 14281

URL: http://svn.erp5.org?rev=14281&view=rev
Log:
by Nicolas, allow to specify product name when importing a conduit

Modified:
    erp5/trunk/products/ERP5SyncML/XMLSyncUtils.py

Modified: erp5/trunk/products/ERP5SyncML/XMLSyncUtils.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5SyncML/XMLSyncUtils.py?rev=14281&r1=14280&r2=14281&view=diff
==============================================================================
--- erp5/trunk/products/ERP5SyncML/XMLSyncUtils.py (original)
+++ erp5/trunk/products/ERP5SyncML/XMLSyncUtils.py Mon Apr 30 17:25:13 2007
@@ -1118,9 +1118,16 @@
 
     alert_code = self.getAlertCode(remote_xml)
     # Import the conduit and get it
-    conduit_name = subscriber.getConduit()
-    conduit_module = __import__('.'.join([Conduit.__name__, conduit_name]), globals(), locals(), [''])
-    conduit = getattr(conduit_module, conduit_name)()
+    if conduit_name.startswith('Products'):
+      path = conduit_name
+      conduit_name = conduit_name.split('.')[-1]
+      LOG('SyncMLUtils.SyncModif (path,conduit_name)',0,(path,conduit_name))
+      conduit_module = __import__(path, globals(), locals(), [''])
+      conduit = getattr(conduit_module, conduit_name)()
+    else:
+      conduit_module = __import__('.'.join([Conduit.__name__, conduit_name]), 
+                                  globals(), locals(), [''])
+      conduit = getattr(conduit_module, conduit_name)()
     LOG('SyncModif, subscriber:',0,subscriber)
     # Then apply the list of actions
     (xml_confirmation,has_next_action,cmd_id) = self.applyActionList(cmd_id=cmd_id,




More information about the Erp5-report mailing list