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

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Jan 11 21:55:17 CET 2011


Author: bh
Date: 2011-01-11 21:55:16 +0100 (Tue, 11 Jan 2011)
New Revision: 4491

Modified:
   base/trunk/ChangeLog
   base/trunk/mpulsweb/model/case.py
Log:
Adapt to libformed revision 293:8a6f4c270c21

* mpulsweb/model/case.py (MPulsXMLImporter): New base class
DBXMLImporter.  In libformed 293:8a6f4c270c21 XMLImporter has been
split into a generic part and a DB specific part and we need the
latter here.
(MPulsXMLImporter.__init__, MPulsXMLImporter.import_xml)
(MPulsXMLImporter.import_case): Adapt to new base class.


Modified: base/trunk/ChangeLog
===================================================================
--- base/trunk/ChangeLog	2011-01-11 20:53:56 UTC (rev 4490)
+++ base/trunk/ChangeLog	2011-01-11 20:55:16 UTC (rev 4491)
@@ -1,5 +1,16 @@
 2011-01-11  Bernhard Herzog  <bh at intevation.de>
 
+	Adapt to libformed revision 293:8a6f4c270c21
+
+	* mpulsweb/model/case.py (MPulsXMLImporter): New base class
+	DBXMLImporter.  In libformed 293:8a6f4c270c21 XMLImporter has been
+	split into a generic part and a DB specific part and we need the
+	latter here.
+	(MPulsXMLImporter.__init__, MPulsXMLImporter.import_xml)
+	(MPulsXMLImporter.import_case): Adapt to new base class.
+
+2011-01-11  Bernhard Herzog  <bh at intevation.de>
+
 	Adapt to libformed revision 275:f922623c6b08
 
 	* mpulsweb/model/logbook.py (new_node): New. Helper function for

Modified: base/trunk/mpulsweb/model/case.py
===================================================================
--- base/trunk/mpulsweb/model/case.py	2011-01-11 20:53:56 UTC (rev 4490)
+++ base/trunk/mpulsweb/model/case.py	2011-01-11 20:55:16 UTC (rev 4491)
@@ -40,7 +40,8 @@
 from formed.meta.data import RepeatNode, DateLeaf, IntLeaf, TextLeaf,\
      ChoiceNode, RuleLeaf
 from formed.instance.backends.postgres import DBFactory as InstanceFactory
-from formed.instance.backends.xmlimport import XMLImporter, XMLImportException
+from formed.instance.backends.xmlimport import XMLImportException
+from formed.instance.backends.dbxmlimport import DBXMLImporter
 from formed.instance.backends.common import RuleEvalContext
 from formed.instance.tree import SetDataException
 
@@ -1353,7 +1354,7 @@
 
 
 
-class MPulsXMLImporter(XMLImporter):
+class MPulsXMLImporter(DBXMLImporter):
 
     """MPuls specific extension for the libform XML importer"""
 
@@ -1368,13 +1369,13 @@
         if extra_factories is None:
             extra_factories = dict()
         extra_factories["tagebuch"] = get_logbook_import_factory()
-        XMLImporter.__init__(self, meta_tree, extra_factories)
+        DBXMLImporter.__init__(self, meta_tree, extra_factories)
 
     def import_xml(self, db, infile):
         """Extend the base class method to reformat rule violation exceptions
         """
         try:
-            XMLImporter.import_xml(self, db, infile)
+            DBXMLImporter.import_xml(self, db, infile)
         except XMLImportException, e:
             if e.set_data_errors:
                 raise XMLImportException(self.format_errors(e.uuid,
@@ -1398,7 +1399,7 @@
 
     def import_case(self, factory, cursor, components):
         if self.import_allowed(cursor, components):
-            tree = XMLImporter.import_case(self, factory, cursor, components)
+            tree = DBXMLImporter.import_case(self, factory, cursor, components)
             if "tagebuch" in components:
                 # only try to import logbook if there actually was a
                 # logbook for the case



More information about the Mpuls-commits mailing list