From 5a60cff9a1862451b7b99a4d0e4f579c3dcf75d1 Mon Sep 17 00:00:00 2001 From: Ebag333 Date: Sat, 20 May 2017 11:13:28 -0700 Subject: [PATCH] Fixes EVEMon import. Security status was added, but wasn't handled in the EVEMon import. Also, default secstatus to 0 if it's somehow missing. --- eos/saveddata/character.py | 2 +- service/character.py | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/eos/saveddata/character.py b/eos/saveddata/character.py index c02f84464..9ab92c15c 100644 --- a/eos/saveddata/character.py +++ b/eos/saveddata/character.py @@ -119,7 +119,7 @@ class Character(object): return all0 - def apiUpdateCharSheet(self, skills, secStatus): + def apiUpdateCharSheet(self, skills, secStatus=0): del self.__skills[:] self.__skillIdMap.clear() for skillRow in skills: diff --git a/service/character.py b/service/character.py index 0ae8158cb..2075ffdaa 100644 --- a/service/character.py +++ b/service/character.py @@ -77,6 +77,7 @@ class CharacterImportThread(threading.Thread): pyfalog.error("Incorrect EVEMon XML sheet") raise RuntimeError("Incorrect EVEMon XML sheet") name = doc.getElementsByTagName("name")[0].firstChild.nodeValue + securitystatus = doc.getElementsByTagName("securityStatus")[0].firstChild.nodeValue or 0 skill_els = doc.getElementsByTagName("skill") skills = [] for skill in skill_els: @@ -93,7 +94,7 @@ class CharacterImportThread(threading.Thread): skill.getAttribute("level"), ) char = sCharacter.new(name + " (EVEMon)") - sCharacter.apiUpdateCharSheet(char.ID, skills) + sCharacter.apiUpdateCharSheet(char.ID, skills, securitystatus) except Exception, e: pyfalog.error("Exception on character import:") pyfalog.error(e) @@ -378,9 +379,9 @@ class Character(object): wx.CallAfter(guiCallback, e) @staticmethod - def apiUpdateCharSheet(charID, skills): + def apiUpdateCharSheet(charID, skills, securitystatus): char = eos.db.getCharacter(charID) - char.apiUpdateCharSheet(skills) + char.apiUpdateCharSheet(skills, securitystatus) eos.db.commit() @staticmethod