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

Method validator

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

Source from the content-addressed store, hash-verified

438
439 @validates("characterID", "skillID", "level")
440 def validator(self, key, val):
441 if hasattr(self, "_Skill__ro") and self.__ro is True and key != "characterID":
442 raise ReadOnlyException()
443
444 map = {
445 "characterID": lambda _val: isinstance(_val, int),
446 "skillID" : lambda _val: isinstance(_val, int)
447 }
448
449 if not map[key](val):
450 raise ValueError(str(val) + " is not a valid value for " + key)
451 else:
452 return val
453
454 def __deepcopy__(self, memo):
455 copy = Skill(self.character, self.item, self.level, self.__ro)

Callers

nothing calls this directly

Calls 1

ReadOnlyExceptionClass · 0.70

Tested by

no test coverage detected