MCPcopy Create free account
hub / github.com/pyfa-org/Pyfa / Validate

Method Validate

gui/targetProfileEditor.py:64–80  ·  view source on GitHub ↗
(self, win)

Source from the content-addressed store, hash-verified

62 return TargetProfileNameValidator()
63
64 def Validate(self, win):
65 entityEditor = win.Parent.parent
66 textCtrl = self.GetWindow()
67 text = textCtrl.GetValue().strip()
68
69 try:
70 if len(text) == 0:
71 raise ValueError(_t("You must supply a name for your Target Profile!"))
72 elif text in [x.rawName for x in entityEditor.choices]:
73 raise ValueError(_t("Target Profile name already in use, please choose another."))
74
75 return True
76 except ValueError as e:
77 pyfalog.error(e)
78 wx.MessageBox("{}".format(e), _t("Error"))
79 textCtrl.SetFocus()
80 return False
81
82
83class TargetProfileEntityEditor(EntityEditor):

Callers

nothing calls this directly

Calls 2

_tFunction · 0.50
GetValueMethod · 0.45

Tested by

no test coverage detected