Minor modifications.
This commit is contained in:
@@ -25,8 +25,6 @@ import eos.db
|
||||
import eos
|
||||
|
||||
class Character(object):
|
||||
__all5 = None
|
||||
__all0 = None
|
||||
__itemList = None
|
||||
__itemIDMap = None
|
||||
__itemNameMap = None
|
||||
@@ -66,29 +64,30 @@ class Character(object):
|
||||
|
||||
@classmethod
|
||||
def getAll5(cls):
|
||||
if cls.__all5 is None:
|
||||
import eos.db
|
||||
all5 = eos.db.getCharacter("All 5")
|
||||
if all5 is None:
|
||||
all5 = Character("All 5")
|
||||
all5.defaultLevel = 5
|
||||
eos.db.add(all5)
|
||||
all5 = eos.db.getCharacter("All 5")
|
||||
|
||||
cls.__all5 = all5
|
||||
return cls.__all5
|
||||
if all5 is None:
|
||||
# We do not have to be afraid of committing here and saving
|
||||
# edited character data. If this ever runs, it will be during the
|
||||
# get character list phase when pyfa first starts
|
||||
all5 = Character("All 5")
|
||||
all5.defaultLevel = 5
|
||||
eos.db.character_session.add(all5)
|
||||
eos.db.character_session.commit()
|
||||
|
||||
return all5
|
||||
|
||||
@classmethod
|
||||
def getAll0(cls):
|
||||
if cls.__all0 is None:
|
||||
import eos.db
|
||||
all0 = eos.db.getCharacter("All 0")
|
||||
if all0 is None:
|
||||
all0 = Character("All 0")
|
||||
all0.defaultLevel = None
|
||||
eos.db.add(all0)
|
||||
all0 = eos.db.getCharacter("All 0")
|
||||
|
||||
cls.__all0 = all0
|
||||
return cls.__all0
|
||||
if all0 is None:
|
||||
all0 = Character("All 0")
|
||||
all0.defaultLevel = None
|
||||
eos.db.character_session.add(all0)
|
||||
eos.db.character_session.commit()
|
||||
|
||||
return all0
|
||||
|
||||
def __init__(self, name):
|
||||
self.name = name
|
||||
@@ -109,7 +108,6 @@ class Character(object):
|
||||
del self.__skills[:]
|
||||
self.__skillIdMap.clear()
|
||||
for skillRow in skills:
|
||||
|
||||
self.addSkill(Skill(skillRow["typeID"], skillRow["level"]))
|
||||
|
||||
@property
|
||||
|
||||
@@ -652,7 +652,7 @@ class APIView (wx.Panel):
|
||||
|
||||
sChar = service.Character.getInstance()
|
||||
try:
|
||||
list = sChar.charList(self.Parent.Parent.getActiveCharacter(), self.inputID.GetLineText(0), self.inputKey.GetLineText(0))
|
||||
list = sChar.apiCharList(self.Parent.Parent.getActiveCharacter(), self.inputID.GetLineText(0), self.inputKey.GetLineText(0))
|
||||
except service.network.AuthenticationError, e:
|
||||
self.stStatus.SetLabel("Authentication failure. Please check keyID and vCode combination.")
|
||||
except service.network.TimeoutError, e:
|
||||
|
||||
@@ -171,25 +171,19 @@ class Character(object):
|
||||
thread.start()
|
||||
|
||||
def all0(self):
|
||||
all0 = eos.types.Character.getAll0()
|
||||
eos.db.commit()
|
||||
return all0
|
||||
return eos.types.Character.getAll0()
|
||||
|
||||
def all0ID(self):
|
||||
return self.all0().ID
|
||||
|
||||
def all5(self):
|
||||
all5 = eos.types.Character.getAll5()
|
||||
eos.db.commit()
|
||||
return all5
|
||||
return eos.types.Character.getAll5()
|
||||
|
||||
def all5ID(self):
|
||||
return self.all5().ID
|
||||
|
||||
def getCharacterList(self):
|
||||
baseChars = [eos.types.Character.getAll0(), eos.types.Character.getAll5()]
|
||||
# Flush incase all0 & all5 weren't in the db yet
|
||||
eos.db.commit()
|
||||
sFit = service.Fit.getInstance()
|
||||
|
||||
for thing in eos.db.character_session.dirty:
|
||||
@@ -298,7 +292,7 @@ class Character(object):
|
||||
id, key, default, _ = self.getApiDetails(charID)
|
||||
return id is not "" and key is not "" and default is not ""
|
||||
|
||||
def charList(self, charID, userID, apiKey):
|
||||
def apiCharList(self, charID, userID, apiKey):
|
||||
char = eos.db.getCharacter(charID)
|
||||
|
||||
char.apiID = userID
|
||||
@@ -345,8 +339,6 @@ class Character(object):
|
||||
else:
|
||||
skill.level = level
|
||||
|
||||
eos.db.commit()
|
||||
|
||||
def addImplant(self, charID, itemID):
|
||||
char = eos.db.getCharacter(charID)
|
||||
implant = eos.types.Implant(eos.db.getItem(itemID))
|
||||
|
||||
Reference in New Issue
Block a user