示例#1
0
文件: errors.py 项目: fishroot/nemoa
 def __init__(self, name: str, obj: object) -> None:
     that = entity.get_name(type(obj))
     msg = f"{name} requires to be callable not {that}"
     super().__init__(msg)
示例#2
0
文件: errors.py 项目: fishroot/nemoa
 def __init__(self, name: str, obj: object, ref: Class) -> None:
     this = entity.get_name(ref)
     that = entity.get_name(obj)
     msg = f"{name} requires to be a subclass of {this} not {that}"
     super().__init__(msg)
示例#3
0
文件: errors.py 项目: fishroot/nemoa
 def __init__(self, name: str, obj: object, classinfo: object) -> None:
     this = entity.get_lang_repr(classinfo, separator='or')
     that = entity.get_name(type(obj))
     msg = f"{name} requires to be of type {this} not {that}"
     super().__init__(msg)
示例#4
0
文件: errors.py 项目: fishroot/nemoa
 def __init__(self, name: str, obj: object) -> None:
     this = entity.get_name(obj)
     msg = f"{this} missing required keyword argument '{name}'"
     super().__init__(msg)
示例#5
0
文件: errors.py 项目: fishroot/nemoa
 def __init__(self, obj: object, attr: str) -> None:
     that = entity.get_name(obj)
     msg = f"'{attr}' is a read-only attribute of {that}"
     super().__init__(msg)
示例#6
0
文件: errors.py 项目: fishroot/nemoa
 def __init__(self, obj: object, attr: str) -> None:
     that = entity.get_name(obj)
     msg = f"{that} has no attribute '{attr}'"
     super().__init__(msg)