Changeset 25

Show
Ignore:
Timestamp:
11/27/07 03:40:56 (6 months ago)
Author:
nerijusb
Message:

python-xml (PyXML) no longer needed

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/xmltools.py

    r15 r25  
    2121 
    2222import xml.dom.minidom 
    23 import xml.dom.ext 
    2423 
    2524from lib import meta 
     
    114113    """Write XML file""" 
    115114 
    116     fd = open(path, 'w') 
    117     xml.dom.ext.PrettyPrint(doc, fd) 
     115    import codecs 
     116    fd = codecs.open(path, 'w', 'utf-8') 
     117    doc.writexml(fd, addindent = "  ", newl = "\n", encoding = "UTF-8") 
    118118    fd.close() 
    119      
     119 
    120120 
    121121 
     
    242242    """Write XML file""" 
    243243 
    244     fd = open(path, 'wb') 
    245     xml.dom.ext.PrettyPrint(doc, fd) 
     244    import codecs 
     245    fd = codecs.open(path, 'wb', 'utf-8') 
     246    doc.writexml(fd, addindent = "  ", newl = "\n", encoding = "UTF-8") 
    246247    fd.close() 
    247248 
     
    512513    """Write XML file""" 
    513514 
    514     fd = open(path, 'w') 
    515     xml.dom.ext.PrettyPrint(doc, fd) 
     515    import codecs 
     516    fd = codecs.open(path, 'w', 'utf-8') 
     517    doc.writexml(fd, addindent = "  ", newl = "\n", encoding = "UTF-8") 
    516518    fd.close() 
    517519 
  • trunk/misc/repository/make-addons-list.py

    r15 r25  
    66import md5 
    77import xml.dom.minidom 
    8 import xml.dom.ext 
    98 
    109# 
     
    267266        print "* %s" % filePath 
    268267 
     268    import codecs 
    269269    doc = makeDocument(xmlElements) 
    270     fd = open('opendict-add-ons.xml', 'w') 
    271     xml.dom.ext.PrettyPrint(doc, fd) 
     270    fd = codecs.open('opendict-add-ons.xml', 'w', 'utf-8') 
     271    doc.writexml(fd, addindent = "  ", newl = "\n", encoding = "UTF-8") 
     272    #fd.write(doc.toprettyxml(indent = "  ", newl = "\n")) 
    272273    fd.close() 
    273      
     274 
    274275 
    275276if __name__ == "__main__": 
  • trunk/opendict.py

    r16 r25  
    5151    print >> sys.stderr, "** Error: wxPython library not found" 
    5252    print >> sys.stderr, "** Please install wxPython 2.5 or later to run OpenDict" 
    53     print >> sys.stderr, "**" 
    54     sys.exit(1) 
    55  
    56  
    57 try: 
    58     import xml.dom.ext 
    59 except ImportError: 
    60     print >> sys.stderr, "**" 
    61     print >> sys.stderr, "** Error: Python/XML library not found" 
    62     print >> sys.stderr, "** Please install python-xml (PyXML) to run OpenDict" 
    6353    print >> sys.stderr, "**" 
    6454    sys.exit(1)