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

Method validator

eos/saveddata/fighter.py:360–370  ·  view source on GitHub ↗
(self, key, val)

Source from the content-addressed store, hash-verified

358
359 @validates("ID", "itemID", "chargeID", "amount")
360 def validator(self, key, val):
361 map = {
362 "ID" : lambda _val: isinstance(_val, int),
363 "itemID" : lambda _val: isinstance(_val, int),
364 "chargeID": lambda _val: isinstance(_val, int),
365 "amount" : lambda _val: isinstance(_val, int) and _val >= -1,
366 }
367 if not map[key](val):
368 raise ValueError(str(val) + " is not a valid value for " + key)
369 else:
370 return val
371
372 def clear(self):
373 self.__baseVolley = None

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected