Move fetch function to shared

This commit is contained in:
DarkPhoenix
2018-11-19 16:57:19 +03:00
parent 74bf3fbc8b
commit fa9b3be41c
3 changed files with 41 additions and 19 deletions

View File

@@ -20,6 +20,7 @@
from eos.db.gamedata.queries import getAttributeInfo
from gui.utils.numberFormatter import roundToPrec
from service.port.shared import fetchItem
def exportMutant(mutant, firstPrefix='', prefix=''):
@@ -36,3 +37,17 @@ def exportMutant(mutant, firstPrefix='', prefix=''):
for a in sorted(mutatedAttrs))
exportLines.append('{}{}'.format(prefix, customAttrsLine))
return '\n'.join(exportLines)
def importMutant(lines):
try:
baseName = lines[0]
except IndexError:
return None
baseName = baseName.strip()
mutant = fetchItem(baseName)
# try:
# mutaName = lines[1]
# except IndexError:
# return mutant