def prepare(self, setup_func):
        """This decorator wrap a function which setup a environment before
        running a command
        @manager.prepare(setup_func)
        def some_command():
            pass
        """
        assert inspect.isfunction(setup_func)
        argsspec = inspect.getargspec(setup_func)
        if argsspec.args:
            raise ValueError("prepare function shouldn't have any arguments")

        def decorator(command_func):
            @functools.wraps(command_func)
            def wrapper(*args, **kwgs):
                # Run setup_func before command_func
                setup_func()
                return command_func(*args, **kwgs)
            return wrapper
        return decorator
This decorator wrap a function which setup a environment before
        running a command
        @manager.prepare(setup_func)
        def some_command():
            pass