[Erp5-report] r29160 - /erp5/trunk/products/ERP5SyncML/Conduit/ERP5Conduit.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Thu Sep 24 11:26:21 CEST 2009
Author: daniele
Date: Thu Sep 24 11:26:20 2009
New Revision: 29160
URL: http://svn.erp5.org?rev=29160&view=rev
Log:
The asXML not returns the Pdata type because it became obsolete
use attribute rather than a xpath expression
Modified:
erp5/trunk/products/ERP5SyncML/Conduit/ERP5Conduit.py
Modified: erp5/trunk/products/ERP5SyncML/Conduit/ERP5Conduit.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5SyncML/Conduit/ERP5Conduit.py?rev=29160&r1=29159&r2=29160&view=diff
==============================================================================
--- erp5/trunk/products/ERP5SyncML/Conduit/ERP5Conduit.py [utf8] (original)
+++ erp5/trunk/products/ERP5SyncML/Conduit/ERP5Conduit.py [utf8] Thu Sep 24 11:26:20 2009
@@ -37,8 +37,9 @@
from Globals import PersistentMapping
import pickle
from xml.sax.saxutils import escape, unescape
+from cStringIO import StringIO
import re
-import StringIO
+import cStringIO
import string
from lxml import etree
parser = etree.XMLParser(remove_blank_text=True)
@@ -650,7 +651,7 @@
#copy of xml object for modification
from copy import deepcopy
xml_copy = deepcopy(xml)
- if xml.nsmap == None or xml.nsmap == {}:
+ if xml.nsmap is None or xml.nsmap == {}:
object_element = xml_copy.find(self.xml_object_tag)
id_element = object_element.find('id')
else:
@@ -710,14 +711,14 @@
"""
Retrieve the portal type from an xml
"""
- return '%s' % xml.xpath('string(.//@portal_type)')
+ return xml.get('portal_type')
security.declareProtected(Permissions.AccessContentsInformation,'getPropertyType')
def getPropertyType(self, xml):
"""
Retrieve the portal type from an xml
"""
- return '%s' % xml.xpath('string(.//@type)')
+ return xml.get('type')
security.declareProtected(Permissions.AccessContentsInformation,'getXupdateObjectType')
def getXupdateObjectType(self, xml):
@@ -878,13 +879,8 @@
elif data_type in self.data_type_list:
if data is None:
# data is in blocks
- type_data = node.get('type_data')
- if type_data == 'str':
- data = standard_b64decode(''.join([block.text \
- for block in node.iterchildren()]))
- elif type_data == 'Pdata':
- data = Pdata(standard_b64decode(''.join([block.text \
- for block in node.iterchildren()])))
+ data = ''.join([standard_b64decode(block.text) \
+ for block in node.iterchildren()])
elif data_type in self.pickle_type_list:
data = pickle.loads(standard_b64decode(data))
elif data_type in self.date_type_list:
More information about the Erp5-report
mailing list