Author: jmorliaguet
Date: Thu Apr 13 21:26:34 2006
New Revision: 2834

Modified:
   cpsskins/branches/jmo-perspectives/standard/io/effect.py
   cpsskins/branches/jmo-perspectives/standard/io/widget.py
Log:

- API update



Modified: cpsskins/branches/jmo-perspectives/standard/io/effect.py
==============================================================================
--- cpsskins/branches/jmo-perspectives/standard/io/effect.py    (original)
+++ cpsskins/branches/jmo-perspectives/standard/io/effect.py    Thu Apr 13 
21:26:34 2006
@@ -27,6 +27,11 @@
 from cpsskins.elements.interfaces import IIdentifiable
 from cpsskins.setup.interfaces import IDataExporter, IDataImporter
 
+def serialize(obj):
+    if isinstance(obj, list):
+        return u','.join(obj)
+    return obj
+
 class Exporter(object):
     """Export effects
     """
@@ -38,9 +43,9 @@
         return self.template()
 
     def getInfo(self):
-        attrs = 'type', 'format', 'width', 'height', 'keep_ratio'
+        attrs = 'types', 'format', 'width', 'height', 'keep_ratio'
         context = self.context
-        properties = [{'name': name, 'value': getattr(context, name)}
+        properties = [{'name': name, 'value': serialize(getattr(context, 
name))}
                       for name in attrs]
         return {
             'uri': IIdentifiable(self.context).getURI(),

Modified: cpsskins/branches/jmo-perspectives/standard/io/widget.py
==============================================================================
--- cpsskins/branches/jmo-perspectives/standard/io/widget.py    (original)
+++ cpsskins/branches/jmo-perspectives/standard/io/widget.py    Thu Apr 13 
21:26:34 2006
@@ -27,6 +27,11 @@
 from cpsskins.elements.interfaces import IIdentifiable
 from cpsskins.setup.interfaces import IDataExporter, IDataImporter
 
+def serialize(obj):
+    if isinstance(obj, list):
+        return u','.join(obj)
+    return obj
+
 class Exporter(object):
     """Export widgets
     """
@@ -38,9 +43,9 @@
         return self.template()
 
     def getInfo(self):
-        attrs = 'type',
+        attrs = 'types',
         context = self.context
-        properties = [{'name': name, 'value': getattr(context, name)}
+        properties = [{'name': name, 'value': serialize(getattr(context, 
name))}
                       for name in attrs]
         return {
             'uri': IIdentifiable(self.context).getURI(),
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to