[Formed-commits] r399 - in trunk: . formed/formed/plugins/export
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Mon Sep 20 16:51:39 CEST 2010
Author: frank
Date: 2010-09-20 16:51:38 +0200 (Mon, 20 Sep 2010)
New Revision: 399
Modified:
trunk/ChangeLog
trunk/formed/formed/plugins/export/latex.py
Log:
Enhanced LaTeX output
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2010-09-16 15:04:46 UTC (rev 398)
+++ trunk/ChangeLog 2010-09-20 14:51:38 UTC (rev 399)
@@ -1,3 +1,9 @@
+2010-09-20 Frank Koormann <frank.koormann at intevation.de>
+
+ * formed/formed/plugins/export/latex.py (RecursiveExporter):
+ Add "required"-field information to output and include
+ choice list contents.
+
2010-09-16 Bernhard Herzog <bh at intevation.de>
Avoid database deadlocks that can happen when database clients try
Modified: trunk/formed/formed/plugins/export/latex.py
===================================================================
--- trunk/formed/formed/plugins/export/latex.py 2010-09-16 15:04:46 UTC (rev 398)
+++ trunk/formed/formed/plugins/export/latex.py 2010-09-20 14:51:38 UTC (rev 399)
@@ -65,7 +65,7 @@
def fillRow(k, field = ""):
c = [texize(esc(i)) for i in k]
- return "" + " & ".join(c) + ("\\\\ %s\n \\hline" % field )
+ return "" + " & ".join(c) + ("\\\\ %s\n " % field )
def getAnonymizeType(name):
if name:
@@ -121,11 +121,14 @@
@checkMode
def _matchText(self, nc, out):
- print >> out, fillRow([
- nc.getDescription(),
- LOCAL_NAME.get(nc.__class__, "Unbekannt"),
- getAnonymizeType(nc.getFunction()),
- nc.getName(),
+ desc = esc(nc.getDescription())
+ ln = esc(LOCAL_NAME.get(nc.__class__, "unbekannt"))
+ flags = nc.getFlags()
+ if flags.find("required"):
+ ln = ln + ", {\sl Pflichtfeld}"
+ name = esc(nc.getName())
+ anon = getAnonymizeType(nc.getFunction())
+ print >> out, fillRow([desc, ln, anon, name
# nc.getAttribute("size"),
# nc.getAttribute("maxlength"),
# nc.getAttribute("minvalue"),
@@ -139,7 +142,7 @@
@checkMode
def _matchBoolean(self, nc, out):
-# print >> out, '%s & & \\\\' % esc(nc.getDescription())
+ print >> out, ' & \\multicolumn{3}{p{14cm}}{%s}\\\\' % esc(nc.getDescription())
# print >> out, '\\hline'
pass
@@ -147,6 +150,9 @@
def _matchChoice(self, nc, out):
desc = esc(nc.getDescription())
ln = esc(LOCAL_NAME.get(nc.__class__, "unbekannt"))
+ flags = nc.getFlags()
+ if flags.find("required"):
+ ln = ln + ", {\sl Pflichtfeld}"
name = esc(nc.getName())
anon = getAnonymizeType(nc.getFunction())
print >> out, fillRow([desc, ln, anon, name],
@@ -159,7 +165,8 @@
c = nc.getChildren()
if c: c = len(c)
else: c = 0
- print >> out, '<tr><td></td><td>Externe Liste mit %d Einträgen</td><td colspan="8"></td><td></td></tr>' % c
+ print >> out, u' & \\multicolumn{3}{p{14cm}}{' \
+ u'Externe Liste mit %d Einträgen}\\\\' % c
@checkMode
def _exportRecursiveAsLaTeX(self, node, out, d):
@@ -192,9 +199,11 @@
self._matchText(nc, out)
- if isinstance(nc, (data.GroupNode, data.PageNode)):
+ if isinstance(nc, (data.GroupNode, data.PageNode, data.ChoiceNode)):
self._exportRecursiveAsLaTeX(nc, out, d)
+ print >> out, u'\\hline\n'
+
def exportRecursiveAsLaTeX(self, node, out):
self.prepareDescent()
self._exportRecursiveAsLaTeX(node, out, 0)
More information about the Formed-commits
mailing list