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

Method validator

eos/saveddata/character.py:296–306  ·  view source on GitHub ↗
(self, key, val)

Source from the content-addressed store, hash-verified

294
295 @validates("ID", "name", "ownerID")
296 def validator(self, key, val):
297 map = {
298 "ID" : lambda _val: isinstance(_val, int),
299 "name" : lambda _val: True,
300 "ownerID": lambda _val: isinstance(_val, int) or _val is None
301 }
302
303 if not map[key](val):
304 raise ValueError(str(val) + " is not a valid value for " + key)
305 else:
306 return val
307
308 def __repr__(self):
309 return "Character(ID={}, name={}) at {}".format(

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected