Rework of the API import routines, now more task based

This is step one of cleaning up the eve_api application and replacing the working core with a more stable, celery based import queue. In addition we've added the ability to import a character just based on character ID, this should allow for populated corporate CEO positions on corps.
This commit is contained in:
2010-12-01 16:04:36 +00:00
parent 394b81cb5e
commit f5ece1c8c3
10 changed files with 347 additions and 242 deletions

26
eve_api/utils.py Normal file
View File

@@ -0,0 +1,26 @@
def basic_xml_parse(nodes):
""" Parses a minidom set of nodes into a tree dict """
values = {}
for node in nodes:
if node.nodeType == 1:
node.normalize()
if len(node.childNodes) == 1:
values[node.tagName] = node.childNodes[0].nodeValue
else:
nv = {}
if node.tagName == "rowset":
rset = []
for nd in node.childNodes:
if nd.nodeType == 1:
d = {}
for e in nd.attributes.keys():
d[e] = nd.attributes[e].value
rset.append(d)
values[node.attributes['name'].value] = rset
else:
for nd in node.childNodes:
if nd.nodeType == 1:
nv[nd.tagName] = nd.childNodes[0].nodeValue
values[node.tagName] = nv
return values