[Formed-commits] r389 - trunk/formed/formed/plugins/export
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Mon Aug 9 17:36:53 CEST 2010
Author: torsten
Date: 2010-08-09 17:36:53 +0200 (Mon, 09 Aug 2010)
New Revision: 389
Modified:
trunk/formed/formed/plugins/export/rules_sql.py
Log:
Add description to output
Modified: trunk/formed/formed/plugins/export/rules_sql.py
===================================================================
--- trunk/formed/formed/plugins/export/rules_sql.py 2010-08-09 13:40:14 UTC (rev 388)
+++ trunk/formed/formed/plugins/export/rules_sql.py 2010-08-09 15:36:53 UTC (rev 389)
@@ -148,12 +148,15 @@
all_rules = list(document.findAllByClass(data.RuleLeaf, mode, allModes))
where = []
for idx, rule in enumerate(all_rules):
+ tmp_sql = []
if rule.getMark().find('error') < 0: continue
desc = rule.getDescription()
if not desc: desc = rule.getValue()
- #sql2.append("-- %s\n" % desc)
- #sql2.append("-- Prog %s\n" % rule.getExpr().prog)
- where.append("%s" % recursive_parse(rule.getExpr().prog, document))
+ tmp_sql.append("\n")
+ tmp_sql.append("--")
+ tmp_sql.append("-- %s\n" % desc)
+ tmp_sql.append("%s" % recursive_parse(rule.getExpr().prog, document))
+ where.append("\n".join(tmp_sql))
sql.append("\nAND ".join(where))
sql.append(")")
print >> out, "\n".join(sql)
More information about the Formed-commits
mailing list