[Formed-commits] r364 - in trunk: . formed/formed/plugins/export
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Mon May 17 12:58:51 CEST 2010
Author: frank
Date: 2010-05-17 12:58:49 +0200 (Mon, 17 May 2010)
New Revision: 364
Modified:
trunk/ChangeLog
trunk/formed/formed/plugins/export/xls.py
Log:
Export references (ie where are the lists used).
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2010-05-17 10:56:36 UTC (rev 363)
+++ trunk/ChangeLog 2010-05-17 10:58:49 UTC (rev 364)
@@ -2,6 +2,9 @@
* formed/formed/plugins/export/latex.py: Improved section labeling.
+ * formed/formed/plugins/export/xls.py:
+ Export references (ie where are the lists used).
+
2010-04-30 Torsten Irländer <torsten.irlaender at intevation.de>
* formed/formed/plugins/modify/rules.py (VariableType.substitute): Do
Modified: trunk/formed/formed/plugins/export/xls.py
===================================================================
--- trunk/formed/formed/plugins/export/xls.py 2010-05-17 10:56:36 UTC (rev 363)
+++ trunk/formed/formed/plugins/export/xls.py 2010-05-17 10:58:49 UTC (rev 364)
@@ -99,9 +99,10 @@
class EnumerationType:
- def __init__(self, name, keys_values):
+ def __init__(self, name, description, keys_values):
self.name = name
self.keys_values = keys_values
+ self.references = [(name, description)]
def isSame(self, other):
return self.keys_values == other.keys_values
@@ -113,7 +114,17 @@
sheet.write(row, 0, '%d' % k)
sheet.write(row, 1, '%s' % escape(v))
row +=1
+ row+=2
+ sheet.write(row, 0, 'Bezug:')
+ row +=1
+ for k, v in self.references:
+ sheet.write(row, 0, '%s' % escape(k))
+ sheet.write(row, 1, '%s' % escape(v))
+ row +=1
+ def addReference(self, name, description):
+ self.references.append((name, description))
+
class TableType:
def __init__(self, name, maxOccurs="unbounded"):
@@ -190,14 +201,17 @@
# enum_name = "enum_%d_type" % len(self.enums)
enum_name = "ja_nein"
+ enum_description = "Ja/Nein"
- enum = EnumerationType(enum_name, key_values)
+ enum = EnumerationType(enum_name, enum_description, key_values)
base = self.findEnumeration(enum)
if not base:
base = enum
self.enums.append(enum)
+# else:
+# base.addReference(enum_name, enum_description)
self.tableStack[-1].appendItem(
BasedType(bool.getName(), bool, base.name))
@@ -246,14 +260,17 @@
keys_values.sort()
enum_name = choice.getName()
+ enum_description = choice.getDescription()
- enum = EnumerationType(enum_name, keys_values)
+ enum = EnumerationType(enum_name, enum_description, keys_values)
base = self.findEnumeration(enum)
if not base:
base = enum
self.enums.append(enum)
+ else:
+ base.addReference(enum_name, enum_description)
self.tableStack[-1].appendItem(
BasedType(choice.getName(), choice, base.name))
@@ -277,7 +294,8 @@
keys_values = list(kvs.iteritems())
keys_values.sort()
enum_name = radio.getName()
- enum = EnumerationType(enum_name, keys_values)
+ enum_description = radio.getDescription()
+ enum = EnumerationType(enum_name, enum_description, keys_values)
#base = self.findEnumeration(enum)
#if not base:
More information about the Formed-commits
mailing list