Kaydet (Commit) aa9d613c authored tarafından Suleyman Poyraz's avatar Suleyman Poyraz

Cleaned unuseful str function using

üst 956276cd
...@@ -12,11 +12,11 @@ ...@@ -12,11 +12,11 @@
""" """
xmlext is a helper module for accessing XML files using xmlext is a helper module for accessing XML files using
xml.dom.minidom . It is a convenient wrapper for some ciksemel . It is a convenient wrapper for some
DOM functions, and provides path based get/add functions DOM functions, and provides path based get/add functions
as in KDE API. as in KDE API.
function names are mixedCase for compatibility with minidom, function names are mixedCase for compatibility with ciksemel,
an 'old library' an 'old library'
this implementation uses ciksemel this implementation uses ciksemel
...@@ -75,7 +75,7 @@ def getNodeText(node, tagpath = ""): ...@@ -75,7 +75,7 @@ def getNodeText(node, tagpath = ""):
if child.type() == iks.DATA: if child.type() == iks.DATA:
# KLUDGE: FIXME: python 2.x bug: force decoding as UTF-8 # KLUDGE: FIXME: python 2.x bug: force decoding as UTF-8
child_data = child.data() child_data = child.data()
#print('child_data=', child_data.strip()) # print('child_data=', child_data.strip())
return child_data.strip() # in any case, strip whitespaces... return child_data.strip() # in any case, strip whitespaces...
else: else:
raise XmlError(_("getNodeText: Expected text node, got something else!")) raise XmlError(_("getNodeText: Expected text node, got something else!"))
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
high-level dom functions provided in xmlext module (and sorely lacking high-level dom functions provided in xmlext module (and sorely lacking
in xml.dom :( ) in xml.dom :( )
function names are mixedCase for compatibility with minidom, function names are mixedCase for compatibility with ciksemel,
an 'old library' an 'old library'
this implementation uses ciksemel this implementation uses ciksemel
...@@ -55,11 +55,11 @@ class XmlFile(object): ...@@ -55,11 +55,11 @@ class XmlFile(object):
return self.doc return self.doc
def parsexml(self, file): def parsexml(self, file):
#try: try:
self.doc = iks.parseString(str(file)) self.doc = iks.parseString(file)
return self.doc return self.doc
#except Exception as e: except Exception as e:
#raise Error(_("File '{}' has invalid XML").format(file) ) raise Error(_("File '{}' has invalid XML").format(file) )
def readxml(self, uri, tmpDir='/tmp', sha1sum=False, def readxml(self, uri, tmpDir='/tmp', sha1sum=False,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment