MCPcopy Index your code
hub / github.com/pyfa-org/Pyfa / findrenames

Function findrenames

scripts/itemDiff.py:75–94  ·  view source on GitHub ↗
(ren_dict, query, strip=False)

Source from the content-addressed store, hash-verified

73 return effectid in implemented
74
75 def findrenames(ren_dict, query, strip=False):
76
77 old_namedata = {}
78 new_namedata = {}
79
80 for cursor, dictionary in ((old_cursor, old_namedata), (new_cursor, new_namedata)):
81 cursor.execute(query)
82 for row in cursor:
83 id = row[0]
84 name = row[1]
85 if strip is True:
86 name = re.sub(stripspec, "", name)
87 dictionary[id] = name
88
89 for id in set(old_namedata.keys()).intersection(list(new_namedata.keys())):
90 oldname = old_namedata[id] if old_namedata[id] is not None else 'None'
91 newname = new_namedata[id] if new_namedata[id] is not None else 'None'
92 if oldname != newname:
93 ren_dict[id] = (oldname, newname)
94 return
95
96 def printrenames(ren_dict, title):
97 if len(ren_dict) > 0:

Callers 1

mainFunction · 0.85

Calls 1

keysMethod · 0.45

Tested by

no test coverage detected