fdutils/decorators.py
def capable_of(capability, continue_if_not_capable=False):
    """ functionality capability decorator on classes that has WithCapabilities mixin

    """
    def deco(f):
        @wraps(f)
        def wrapper(*args, **kwargs):
            if args[0].is_not_capable_of(capability):
                if continue_if_not_capable:
                    return None
                else:
                    raise CapabilityError(capability)
            return f(*args, **kwargs)
        return wrapper
    return deco
 functionality capability decorator on classes that has WithCapabilities mixin

    
functionality capability decorator on classes that has WithCapabilities mixin
functionality capability decorator on classes that has WithCapabilities mixin
def capable_of(capability, continue_if_not_capable=False):
    def deco(f):
        @wraps(f)
        def wrapper(*args, **kwargs):
            if args[0].is_not_capable_of(capability):
                if continue_if_not_capable:
                    return None
                else:
                    raise CapabilityError(capability)
            return f(*args, **kwargs)
        return wrapper
    return deco
def capable_of ( capability , continue_if_not_capable = False ) : def deco ( f ) : @ wraps ( f ) def wrapper ( * args , ** kwargs ) : if args [ 0 ] . is_not_capable_of ( capability ) : if continue_if_not_capable : return None else : raise CapabilityError ( capability ) return f ( * args , ** kwargs ) return wrapper return deco
functionality capability decorator on classes that has WithCapabilities mixin
functionality capability decorator on classes that has WithCapabilities mixin
""" functionality capability decorator on classes that has WithCapabilities mixin

    """
capability
continue_if_not_capable