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

Method Validate

gui/setEditor.py:41–57  ·  view source on GitHub ↗
(self, win)

Source from the content-addressed store, hash-verified

39 return ImplantTextValidor()
40
41 def Validate(self, win):
42 entityEditor = win.Parent.parent
43 textCtrl = self.GetWindow()
44 text = textCtrl.GetValue().strip()
45
46 try:
47 if len(text) == 0:
48 raise ValueError(_t("You must supply a name for the Implant Set!"))
49 elif text in [x.name for x in entityEditor.choices]:
50 raise ValueError(_t("Implant Set name already in use, please choose another."))
51
52 return True
53 except ValueError as e:
54 pyfalog.error(e)
55 wx.MessageBox("{}".format(e), _t("Error"))
56 textCtrl.SetFocus()
57 return False
58
59
60class ImplantSetEntityEditor(EntityEditor):

Callers

nothing calls this directly

Calls 2

_tFunction · 0.50
GetValueMethod · 0.45

Tested by

no test coverage detected