Skip to content

Commit

Permalink
Fixes EVEMon import. Security status was added, but wasn't handled in…
Browse files Browse the repository at this point in the history
… the EVEMon import. Also, default secstatus to 0 if it's somehow missing.
  • Loading branch information
Ebag333 committed May 20, 2017
1 parent 12745cd commit 3ed35b0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion eos/saveddata/character.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def getAll0(cls):

return all0

def apiUpdateCharSheet(self, skills, secStatus):
def apiUpdateCharSheet(self, skills, secStatus=0):
del self.__skills[:]
self.__skillIdMap.clear()
for skillRow in skills:
Expand Down
7 changes: 4 additions & 3 deletions service/character.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ def run(self):
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:
Expand All @@ -93,7 +94,7 @@ def run(self):
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)
Expand Down Expand Up @@ -378,9 +379,9 @@ def apiFetchCallback(self, guiCallback, e=None):
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
Expand Down

0 comments on commit 3ed35b0

Please sign in to comment.