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

Method Validate

gui/characterEditor.py:70–86  ·  view source on GitHub ↗
(self, win)

Source from the content-addressed store, hash-verified

68 return CharacterTextValidor()
69
70 def Validate(self, win):
71 textCtrl = self.GetWindow()
72 text = textCtrl.GetValue().strip()
73 sChar = Character.getInstance()
74
75 try:
76 if len(text) == 0:
77 raise ValueError(_t("You must supply a name for the Character!"))
78 elif text in [x.name for x in sChar.getCharacterList()]:
79 raise ValueError(_t("Character name already in use, please choose another."))
80
81 return True
82 except ValueError as e:
83 pyfalog.error(e)
84 wx.MessageBox("{}".format(e), _t("Error"))
85 textCtrl.SetFocus()
86 return False
87
88
89class CharacterEntityEditor(EntityEditor):

Callers

nothing calls this directly

Calls 4

getCharacterListMethod · 0.80
_tFunction · 0.50
GetValueMethod · 0.45
getInstanceMethod · 0.45

Tested by

no test coverage detected