コード例 #1
0
ファイル: signals.py プロジェクト: FlorianLudwig/snaked
def attach_signal_connect_info(attr, obj, func, after, idle):
    """
    Adds signal connection info to function

    Used by signal and trigger decorators
    """
    connect_params = dict(after=after, idle=idle)

    if func:
        if not getattr(func, '__call__'):
            raise Exception('Signal decorator accept callable or connect params')

        append_attr(func, attr, (obj, connect_params))
        return func
    else:
        def inner(func):
            append_attr(func, attr, (obj, connect_params))
            return func

        return inner
コード例 #2
0
def attach_signal_connect_info(attr, obj, func, after, idle):
    """
    Adds signal connection info to function
    
    Used by signal and trigger decorators
    """
    connect_params = dict(after=after, idle=idle)

    if func:
        if not getattr(func, '__call__'):
            raise Exception('Signal decorator accept callable or connect params')
        
        append_attr(func, attr, (obj, connect_params))
        return func
    else:
        def inner(func):
            append_attr(func, attr, (obj, connect_params))
            return func
        
        return inner    
コード例 #3
0
ファイル: signals.py プロジェクト: FlorianLudwig/snaked
 def inner(func):
     append_attr(func, attr, (obj, connect_params))
     return func
コード例 #4
0
 def inner(func):
     append_attr(func, attr, (obj, connect_params))
     return func