[Erp5-report] r25224 - /erp5/trunk/products/ERP5SyncML/XMLSyncUtils.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Wed Jan 21 11:46:36 CET 2009
Author: nicolas
Date: Wed Jan 21 11:46:34 2009
New Revision: 25224
URL: http://svn.erp5.org?rev=25224&view=rev
Log:
Target and Source should be both inside tree
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=25224&r1=25223&r2=25224&view=diff
==============================================================================
--- erp5/trunk/products/ERP5SyncML/XMLSyncUtils.py [utf8] (original)
+++ erp5/trunk/products/ERP5SyncML/XMLSyncUtils.py [utf8] Wed Jan 21 11:46:34 2009
@@ -52,22 +52,20 @@
Since the Header is always almost the same, this is the
way to set one quickly.
"""
- if source:
- if source_name:
- source_name = source_name.decode('utf-8')
- node_to_append = E.Source(E.LocURI(source), E.LocName(source_name or ''))
- else:
- if target_name:
- target_name = target_name.decode('utf-8')
- node_to_append = E.Target(E.LocURI(target), E.LocName(target_name or ''))
-
xml = (E.SyncHdr(
E.VerDTD('1.1'),
E.VerProto('SyncML/1.1'),
E.SessionID('%s' % session_id),
E.MsgID('%s' % msg_id),
- node_to_append
))
+ target_node = E.Target(E.LocURI(target))
+ if target_name:
+ target_node.append(E.LocName(target_name.decode('utf-8')))
+ xml.append(target_node)
+ source_node = E.Source(E.LocURI(source))
+ if source_name:
+ source_node.append(E.LocName(source_name.decode('utf-8')))
+ xml.append(source_node)
if dataCred:
xml.append(E.Cred(
E.Meta(E.Format(authentication_format, xmlns='syncml:metinf'),
More information about the Erp5-report
mailing list