[Formed-commits] r357 - in trunk: . formed/formed/plugins/export
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Wed Apr 28 09:10:34 CEST 2010
Author: roland
Date: 2010-04-28 09:10:33 +0200 (Wed, 28 Apr 2010)
New Revision: 357
Modified:
trunk/ChangeLog
trunk/formed/formed/plugins/export/xls.py
Log:
Radiogroups are exported
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2010-04-08 15:56:34 UTC (rev 356)
+++ trunk/ChangeLog 2010-04-28 07:10:33 UTC (rev 357)
@@ -1,3 +1,7 @@
+2010-04-28 Roland Geider <roland.geider at intevation.de>
+
+ * formed/plugins/export/xls.py: Radiogroups are exported
+
2010-04-08 Torsten Irländer <torsten.irlaender at intevation.de>
* formed/formed/plugins/modify/rules.py
Modified: trunk/formed/formed/plugins/export/xls.py
===================================================================
--- trunk/formed/formed/plugins/export/xls.py 2010-04-08 15:56:34 UTC (rev 356)
+++ trunk/formed/formed/plugins/export/xls.py 2010-04-28 07:10:33 UTC (rev 357)
@@ -260,8 +260,36 @@
@checkMode
def _createRadioGroup(self, radio):
- print >> sys.stderr, "RadioGroup: %s (Not supported yet)" % radio.getName()
+ kvs = {}
+ stack = radio.children[:]
+ while stack:
+ c = stack.pop()
+ if isinstance(c, data.BoolLeaf):
+ desc = c.getDescription()
+ if not desc:
+ desc = ""
+ kvs[int(c.getValue())] = desc
+
+ if not kvs:
+ print >> sys.stderr, "WARNING: radio group '%s' contains no values" % radio.getName()
+ return
+
+ keys_values = list(kvs.iteritems())
+ keys_values.sort()
+ enum_name = radio.getName()
+ enum = EnumerationType(enum_name, keys_values)
+ #base = self.findEnumeration(enum)
+ #if not base:
+ #base = enum
+ #self.enums.append(enum)
+
+ base = enum
+ self.enums.append(enum)
+
+ self.tableStack[-1].appendItem(
+ BasedType(radio.getName(), radio, base.name))
+
@checkMode
def _createGroup(self, group):
repeat = group.isRepeat()
More information about the Formed-commits
mailing list