[Mpuls-commits] r3329 - in base/trunk: . mpulsweb/model

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Aug 3 19:52:56 CEST 2010


Author: bh
Date: 2010-08-03 19:52:55 +0200 (Tue, 03 Aug 2010)
New Revision: 3329

Modified:
   base/trunk/ChangeLog
   base/trunk/mpulsweb/model/case.py
Log:
* mpulsweb/model/case.py (MPulsXMLImporter.state_allows_import):
Added to implement a simple check of the formed version.
Requires libformed revision 212:3fb855168212 to actually work.


Modified: base/trunk/ChangeLog
===================================================================
--- base/trunk/ChangeLog	2010-08-03 16:47:55 UTC (rev 3328)
+++ base/trunk/ChangeLog	2010-08-03 17:52:55 UTC (rev 3329)
@@ -1,5 +1,11 @@
 2010-08-03  Bernhard Herzog  <bh at intevation.de>
 
+	* mpulsweb/model/case.py (MPulsXMLImporter.state_allows_import):
+	Added to implement a simple check of the formed version.
+	Requires libformed revision 212:3fb855168212 to actually work.
+
+2010-08-03  Bernhard Herzog  <bh at intevation.de>
+
 	* mpulsweb/model/case.py (MPulsXMLImporter.import_xml): Extend
 	base class method to better handle rule violations.
 	(MPulsXMLImporter.format_errors): Helper method to format the rule

Modified: base/trunk/mpulsweb/model/case.py
===================================================================
--- base/trunk/mpulsweb/model/case.py	2010-08-03 16:47:55 UTC (rev 3328)
+++ base/trunk/mpulsweb/model/case.py	2010-08-03 17:52:55 UTC (rev 3329)
@@ -1353,3 +1353,10 @@
             # is concerned
             return True
         return row[0] not in (4, 3)
+
+    def version_supported(self, version):
+        accepted = self.structure_tree.get_version()
+        if accepted  != version:
+            raise XMLImportException(_("The XML file has the version '%s',"
+                                       " but supported is only version '%s'")
+                                     % (version, accepted))



More information about the Mpuls-commits mailing list