예제 #1
0
파일: tasks.py 프로젝트: StevenLOL/detie
def run(cmd, hide=None ,*args, **kwargs):
        
    if not hide:
        sys.stdout.write("\x1b[2;38;5;230m")
        print cmd
        sys.stdout.write("\x1b[2;38;5;236m")
        sys.stdout.flush()
        r = _run(cmd, hide=hide, *args, **kwargs)
        sys.stdout.write("\x1b[0m")
        sys.stdout.flush()
    else:
        r = _run(cmd, hide=hide, *args, **kwargs)
    return r
예제 #2
0
def run(*args, **kwargs):
    if 'pty' not in kwargs:
        kwargs['pty'] = True
    if WINDOWS:
        kwargs['pty'] = False
    if 'echo' not in kwargs:
        kwargs['echo'] = True
    return _run(*args, **kwargs)
예제 #3
0
def run(*args, **kwargs):
    if 'pty' not in kwargs:
        kwargs['pty'] = True
    if WINDOWS:
        kwargs['pty'] = False
    if 'echo' not in kwargs:
        kwargs['echo'] = True
    return _run(*args, **kwargs)
예제 #4
0
import invoke

DIRNAME = os.path.dirname(__file__)

# unfortunately invoke is currently a bit broken on windows..
try:
    from invoke import ctask as _task
except ImportError:
    from invoke import task as _task

if invoke.__version_info__ < (0, 22):
    _should_patch = True
elif invoke.__version_info__ < (0, 22 + 22 - 13):  # broken since 13..
    from invoke import run as _run
    try:
        _run('rem')
        _should_patch = False
    except WindowsError:
        _should_patch = True

if _should_patch:
    # https://github.com/pyinvoke/invoke/pull/407
    from invoke import Context

    if not getattr(Context, '_patched', False):
        Context._patched = True
        _orig_run = Context.run

        def run(self, command, **kwargs):
            if sys.platform == 'win32':
                kwargs['shell'] = os.environ['COMSPEC']
예제 #5
0
def run(*args, **kwargs):
    if "pty" not in kwargs:
        kwargs["pty"] = True
    if "echo" not in kwargs:
        kwargs["echo"] = True
    return _run(*args, **kwargs)