Author: jmorliaguet
Date: Sat Apr  8 21:52:42 2006
New Revision: 2792

Modified:
   cpsskins/branches/jmo-perspectives/standard/io/element.py
   cpsskins/branches/jmo-perspectives/standard/io/page.py
   cpsskins/branches/jmo-perspectives/standard/io/theme.py
Log:

- fixed the theme exporter



Modified: cpsskins/branches/jmo-perspectives/standard/io/element.py
==============================================================================
--- cpsskins/branches/jmo-perspectives/standard/io/element.py   (original)
+++ cpsskins/branches/jmo-perspectives/standard/io/element.py   Sat Apr  8 
21:52:42 2006
@@ -41,17 +41,21 @@
         self.request = request
 
     def __call__(self):
-        return u'<?xml version="1.0"?>\n' + self.toXML(self.context)
+        self.output = [u'<?xml version="1.0"?>']
+        self.toXML(self.context)
+        return '\n'.join(self.output)
 
-    def toXML(self, node=None, parent=None, xml=u''):
+    def toXML(self, node=None, parent=None):
+        self.nodeToXML(node, parent=parent)
         for child in node:
-            xml += self.toXML(node[child], parent=node, xml=xml)
+            self.nodeToXML(node[child], parent=node)
 
-        return XML % {
+    def nodeToXML(self, node=None, parent=None):
+        self.output.append(XML % {
             'title': node.title,
             'uri': IIdentifiable(node).getURI(),
             'parent': parent and IIdentifiable(parent).getURI() or u'',
-        } + xml
+        })
 
 class Importer(object):
     """Import an element.

Modified: cpsskins/branches/jmo-perspectives/standard/io/page.py
==============================================================================
--- cpsskins/branches/jmo-perspectives/standard/io/page.py      (original)
+++ cpsskins/branches/jmo-perspectives/standard/io/page.py      Sat Apr  8 
21:52:42 2006
@@ -20,7 +20,6 @@
 from xml.dom.minidom import parseString
 
 from zope.app import pagetemplate
-from zope.app.interface import queryType
 from zope.component import adapts, getMultiAdapter
 from zope.interface import implements
 
@@ -45,7 +44,7 @@
         xml = u''
         for node in context:
             exporter = getMultiAdapter((context[node], request), IDataExporter)
-            xml = exporter().replace('<?xml version="1.0"?>', '')
+            xml += exporter().replace('<?xml version="1.0"?>', '')
 
         return {
             'uri': IIdentifiable(context).getURI(),

Modified: cpsskins/branches/jmo-perspectives/standard/io/theme.py
==============================================================================
--- cpsskins/branches/jmo-perspectives/standard/io/theme.py     (original)
+++ cpsskins/branches/jmo-perspectives/standard/io/theme.py     Sat Apr  8 
21:52:42 2006
@@ -20,7 +20,6 @@
 from xml.dom.minidom import parseString
 
 from zope.app import pagetemplate
-from zope.app.interface import queryType
 from zope.component import adapts, getMultiAdapter
 from zope.interface import implements
 
@@ -45,7 +44,7 @@
         xml = u''
         for page in context.getPages():
             exporter = getMultiAdapter((page, request), IDataExporter)
-            xml = exporter().replace('<?xml version="1.0"?>', '')
+            xml += exporter().replace('<?xml version="1.0"?>', '')
 
         return {
             'uri': IIdentifiable(context).getURI(),
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to