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

Method Validate

gui/patternEditor.py:44–60  ·  view source on GitHub ↗
(self, win)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

_tFunction · 0.50
GetValueMethod · 0.45

Tested by

no test coverage detected