Skip to content

Commit

Permalink
quantumclient.common.serializer module cleanup
Browse files Browse the repository at this point in the history
Remove unused methods in quantumclient.common.serializer.XMLDeserializer
that tries to access non existing attributes of xml node:
* find_first_child_named
* extract_text
* find_children_named

Change-Id: I0aff5933fa75e50748e9d0325d898c2f6836fa58
Fixes: bug #1132850
  • Loading branch information
Tatyana Leontovich committed Feb 27, 2013
1 parent d77f862 commit 406f1ad
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions quantumclient/common/serializer.py
Expand Up @@ -321,27 +321,6 @@ def _from_xml_node(self, node, listnames):
child, listnames)
return result

def find_first_child_named(self, parent, name):
"""Search a nodes children for the first child with a given name"""
for node in parent.childNodes:
if node.nodeName == name:
return node
return None

def find_children_named(self, parent, name):
"""Return all of a nodes children who have the given name"""
for node in parent.childNodes:
if node.nodeName == name:
yield node

def extract_text(self, node):
"""Get the text field contained by the given node"""
if len(node.childNodes) == 1:
child = node.childNodes[0]
if child.nodeType == child.TEXT_NODE:
return child.nodeValue
return ""

def default(self, datastring):
return {'body': self._from_xml(datastring)}

Expand Down

0 comments on commit 406f1ad

Please sign in to comment.