Exemple #1
0
 def validate(cls):
     try:
         return interfaces.implement(interface)(cls)
     except (interfaces.MissingRequiredAttribute,
             interfaces.MissingRequiredClassMethod) as exc:
         error_string = "Error in class `{}`: {}".format(cls.__name__, exc)
         raise exception(error_string)
Exemple #2
0
 def validate(cls):
     try:
         return interfaces.implement(interface)(cls)
     except (
             interfaces.MissingRequiredAttribute,
             interfaces.MissingRequiredClassMethod
     ) as exc:
         error_string = "Error in class `{}`: {}".format(cls.__name__, exc)
         raise exception(error_string)
Exemple #3
0
def redobject(cls):
    """Decorator for implementing redhot objects."""
    return interfaces.implement(_RedObject)(cls)