# Path: fabdeploy/utils.py
# @contextmanager
# def sudo_user():
#     with user(env.conf.sudo_user):
#         yield


from fabric import operations
from fabric.contrib import files
from .utils import sudo_user
__all__ = ['patch_all']


_run_command = operations._run_command
put = operations.put


def _patched_run_command(
    command,
    shell=True,
    pty=True,
    combine_stderr=True,
    sudo=False,
    user=None):
    if sudo:
        with sudo_user():
            return _run_command(command, shell=shell, pty=pty,
                combine_stderr=combine_stderr, sudo=sudo, user=user)
    else:
        return _run_command(command, shell=shell, pty=pty,
            combine_stderr=combine_stderr, sudo=sudo, user=user)


def patched_put(
    local_path=None,
    remote_path=None,
    use_sudo=False,
    mirror_local_mode=False,
    mode=None):
    if use_sudo:

# Path: fabdeploy/utils.py
# @contextmanager
# def sudo_user():
#     with user(env.conf.sudo_user):
#         yield


# Path: fabdeploy/monkey.py
from fabric import operations
from fabric.contrib import files
from .utils import sudo_user

__all__ = ['patch_all']


_run_command = operations._run_command
put = operations.put


def _patched_run_command(
    command,
    shell=True,
    pty=True,
    combine_stderr=True,
    sudo=False,
    user=None):
    if sudo:
        with sudo_user():
            return _run_command(command, shell=shell, pty=pty,
                combine_stderr=combine_stderr, sudo=sudo, user=user)
    else:
        return _run_command(command, shell=shell, pty=pty,
            combine_stderr=combine_stderr, sudo=sudo, user=user)


def patched_put(
    local_path=None,
    remote_path=None,
    use_sudo=False,
    mirror_local_mode=False,
    mode=None):
    if use_sudo:

        with sudo_user():