[Erp5-report] r36619 mayoro - /erp5/trunk/products/ERP5Form/ScribusParser.py

nobody at svn.erp5.org nobody at svn.erp5.org
Sat Jun 26 00:40:26 CEST 2010


Author: mayoro
Date: Sat Jun 26 00:40:25 2010
New Revision: 36619

URL: http://svn.erp5.org?rev=36619&view=rev
Log:
store parsed xml tree to avoid multiple tree creation to accelarate parsing

Modified:
    erp5/trunk/products/ERP5Form/ScribusParser.py

Modified: erp5/trunk/products/ERP5Form/ScribusParser.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Form/ScribusParser.py?rev=36619&r1=36618&r2=36619&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Form/ScribusParser.py [utf8] (original)
+++ erp5/trunk/products/ERP5Form/ScribusParser.py [utf8] Sat Jun 26 00:40:25 2010
@@ -55,9 +55,8 @@ class ScribusParser:
       source = open(scribus_file_descriptor, "rb")
       data = source.read() 
       source.close()
-    data = data.replace('', '\n')
-    data = data.replace('', '\t')
-    self.data = data
+
+    self.parsed_data = etree.XML(data)
 
   def getData(self):
     """
@@ -69,7 +68,7 @@ class ScribusParser:
     """
     Return the content file in XML structured
     """
-    return etree.XML(self.getData())
+    return self.parsed_data
 
 
   def getXMLObjectByTagName(self, tag_name):




More information about the Erp5-report mailing list