]> git.0d.be Git - jack_mixer.git/commitdiff
Remove dependency on python-xml (PyXML) as it's unmaintained (#14894)
authorArnout Engelen <gna@bzzt.net>
Sun, 13 Dec 2009 10:28:01 +0000 (11:28 +0100)
committerFrédéric Péters <fpeters@0d.be>
Sun, 13 Dec 2009 10:28:32 +0000 (11:28 +0100)
jack_mixer.py
serialization_xml.py

index 214fb9fb3549169dd07d353ec2c7de9aa6d37827..2b4ff2f1930e2bb4b2bc2b0699e55402eccbae37 100755 (executable)
@@ -40,14 +40,11 @@ from preferences import PreferencesDialog
 
 sys.path = old_path
 
-try:
-    from serialization_xml import xml_serialization
-    from serialization import serialized_object, serializator
-except ImportError:
-    xml_serialization = None
+from serialization_xml import xml_serialization
+from serialization import serialized_object, serializator
 
-if lash is None or xml_serialization is None:
-    print >> sys.stderr, "Cannot load LASH python bindings or python-xml, you want them unless you enjoy manual jack plumbing each time you use this app"
+if lash is None:
+    print >> sys.stderr, "Cannot load LASH python bindings, you want them unless you enjoy manual jack plumbing each time you use this app"
 
 class jack_mixer(serialized_object):
 
index f2019601723797de9da9bf6b3a524eda02eb5f89..308389b988ede6e61ddbfaa4b50fefefce8c89ac 100644 (file)
 from serialization import *
 import xml.dom
 import xml.dom.minidom
-import xml.dom.ext
 
 class xml_serialization(serialization_backend):
     def __init__(self):
-        self.doctype = xml.dom.implementation.createDocumentType("pyserialzation", None, None)
+        self.doctype = xml.dom.getDOMImplementation().createDocumentType("pyserialization", None, None)
 
     def get_root_serialization_object(self, name):
-        self.doc = xml.dom.implementation.createDocument(xml.dom.EMPTY_NAMESPACE, name, self.doctype)
+        self.doc = xml.dom.getDOMImplementation().createDocument(xml.dom.EMPTY_NAMESPACE, name, self.doctype)
         return xml_serialization_object(self.doc, self.doc.documentElement)
 
     def get_root_unserialization_object(self, name):
@@ -41,12 +40,10 @@ class xml_serialization(serialization_backend):
         return xml_serialization_object(self.doc, child)
 
     def save(self, file):
-        xml.dom.ext.PrettyPrint(self.doc, file)
+        print >>file, self.doc.toprettyxml()
 
     def load(self, file):
         self.doc = xml.dom.minidom.parse(file)
-        #rint "Loaded:"
-        #xml.dom.ext.PrettyPrint(self.doc)
 
 class xml_serialization_object:
     def __init__(self, doc, element):