[Mpuls-commits] r523 - in wasko/trunk: . waskaweb/model

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Thu Jun 11 11:46:49 CEST 2009


Author: teichmann
Date: 2009-06-11 11:46:49 +0200 (Thu, 11 Jun 2009)
New Revision: 523

Modified:
   wasko/trunk/ChangeLog.txt
   wasko/trunk/waskaweb/model/casexml.py
   wasko/trunk/waskaweb/model/semantic.py
Log:
Partial Fix for issue207


Modified: wasko/trunk/ChangeLog.txt
===================================================================
--- wasko/trunk/ChangeLog.txt	2009-06-10 14:06:28 UTC (rev 522)
+++ wasko/trunk/ChangeLog.txt	2009-06-11 09:46:49 UTC (rev 523)
@@ -1,3 +1,11 @@
+2009-06-11	Sascha L. Teichmann <sascha.teichmann at intevation.de>
+
+	Partial Fix for issue207:
+
+	* waskaweb/model/semantic.py: Corrected typo i error message.
+
+	* waskaweb/model/casexml.py: Use FormEd type checking.
+
 2009-06-10	Sascha L. Teichmann <sascha.teichmann at intevation.de>
 
 	Tagged as 1.0.1

Modified: wasko/trunk/waskaweb/model/casexml.py
===================================================================
--- wasko/trunk/waskaweb/model/casexml.py	2009-06-10 14:06:28 UTC (rev 522)
+++ wasko/trunk/waskaweb/model/casexml.py	2009-06-11 09:46:49 UTC (rev 523)
@@ -40,6 +40,8 @@
 
 import waskaweb.model.data as data
 
+from waskaweb.model.semantic import checkAndConvert, SematicError
+
 from xml.sax          import make_parser
 from xml.sax.saxutils import escape
 
@@ -364,6 +366,7 @@
         self.logbook_loader = logbook_loader
         self.cur            = cur
         self.converter      = converter
+        self.errors         = []
 
     def register_loader(self, loader):
         loader.add_factories(
@@ -411,7 +414,14 @@
                 self.uuid = value
             return
 
-        self.data.append((name, DECODERS.get(widget.__class__, lambda s: s)(value)))
+        if value == u'':
+            self.data.append((name, None))
+        else:
+            try:
+                value = checkAndConvert(widget, value)
+                self.data.append((name, value))
+            except SematicError, se:
+                self.errors.append(se.value)
 
     def finish(self):
         create_case, data = True, None
@@ -463,7 +473,8 @@
 
         # apply the rules
 
-        errors = []
+        errors = self.errors
+        self.errors = []
 
         for var, value in self.data:
             old_value = get_data(var)

Modified: wasko/trunk/waskaweb/model/semantic.py
===================================================================
--- wasko/trunk/waskaweb/model/semantic.py	2009-06-10 14:06:28 UTC (rev 522)
+++ wasko/trunk/waskaweb/model/semantic.py	2009-06-11 09:46:49 UTC (rev 523)
@@ -294,10 +294,10 @@
                     try:
                         return int(v)
                     except ValueError:
-                        raise SematicError(u"'%s' ist kein valider wert für '%s'" % (
+                        raise SematicError(u"'%s' ist kein valider Wert für '%s'." % (
                             value, nc.getName()))
 
-        raise SematicError(u"'%s' ist kein valider wert für '%s'" % (
+        raise SematicError(u"'%s' ist kein valider Wert für '%s'." % (
             value, nc.getName()))
 
 class RadioConverter(Converter):



More information about the Mpuls-commits mailing list