@@ -0,0 +1,1267 @@
+%22%22%22%0AThis module allows you to send/receive signals during your deployment process.%0A%22%22%22%0A%0Afrom collections import defaultdict%0Afrom functools import wraps%0A%0Afrom fabric.api import task as fabric_task%0A%0A%0A_callbacks = defaultdict(list)%0A%0A%0Adef emit(signal):%0A    %22%22%22%0A    Make all the receivers of this signal aware that it's been sent.%0A    %22%22%22%0A    for callback in _callbacks%5Bsignal%5D:%0A        callback()%0A%0A%0Adef register(function):%0A    %22%22%22%0A    Decorator that will emit pre_ and post_ signals before and after the%0A    function is executed.%0A    %22%22%22%0A    @wraps(function)%0A    def wrapper(*args, **kwargs):%0A        emit(%22pre_%25s%22 %25 function.__name__)%0A        ret = function(*args, **kwargs)%0A        emit(%22post_%25s%22 %25 function.__name__)%0A%0A        return ret%0A%0A    return wrapper%0A%0A%0Adef on(signal):%0A    %22%22%22%0A    Decorator that will call the given function when the given signal is%0A    emitted.%0A    %22%22%22%0A    def wrapper(function):%0A        %22%22%22%0A        Add the given callback to the list of receivers of the given signal.%0A        %22%22%22%0A        _callbacks%5Bsignal%5D.append(function)%0A%0A    return wrapper%0A%0A%0Adef task(function):%0A    %22%22%22%0A    Convenience decorator that overrides the default Fabric task decorator and%0A    adds pre_ and post_ signals to it.%0A    %22%22%22%0A    return register(fabric_task(function))%0A

add signals module