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

Method validator

eos/saveddata/fit.py:477–488  ·  view source on GitHub ↗
(self, key, val)

Source from the content-addressed store, hash-verified

475
476 @validates("ID", "ownerID", "shipID")
477 def validator(self, key, val):
478 map = {
479 "ID": lambda _val: isinstance(_val, int),
480 "ownerID": lambda _val: isinstance(_val, int) or _val is None,
481 "shipID": lambda _val: isinstance(_val, int) or _val is None
482 }
483
484 if not map[key](val):
485
486 raise ValueError(str(val) + " is not a valid value for " + key)
487 else:
488 return val
489
490 def canFit(self, item):
491 # Whereas Module.fits() deals with current state of the fit in order to determine if somethign fits (for example maxGroupFitted which can be modified by effects),

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected