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

Method validator

eos/saveddata/implant.py:101–111  ·  view source on GitHub ↗
(self, key, val)

Source from the content-addressed store, hash-verified

99
100 @validates("fitID", "itemID", "active")
101 def validator(self, key, val):
102 map = {
103 "fitID" : lambda _val: isinstance(_val, int),
104 "itemID": lambda _val: isinstance(_val, int),
105 "active": lambda _val: isinstance(_val, bool)
106 }
107
108 if not map[key](val):
109 raise ValueError(str(val) + " is not a valid value for " + key)
110 else:
111 return val
112
113 def __deepcopy__(self, memo):
114 copy = Implant(self.item)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected