diff options
Diffstat (limited to 'ranger/core/runner.py')
-rw-r--r-- | ranger/core/runner.py | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/ranger/core/runner.py b/ranger/core/runner.py index cd019be4..e5fc33fa 100644 --- a/ranger/core/runner.py +++ b/ranger/core/runner.py @@ -9,15 +9,12 @@ It gives you highlevel control about how processes are run. Example: run = Runner(logfunc=print) run('sleep 2', wait=True) # waits until the process exists -run(['ls', '--help'], flags='p') # pipes output to pager +run(['ls', '--help'], flags='t') # runs in a new terminal run() # prints an error message List of allowed flags: -s: silent mode. output will be discarded. f: fork the process. -p: redirect output to the pager c: run only the current file (not handled here) -w: wait for enter-press afterwards r: run application with root privilege (requires sudo) t: run application in a new terminal window (An uppercase key negates the respective lower case flag) @@ -153,24 +150,9 @@ class Runner(object): # Evaluate the flags to determine keywords # for Popen() and other variables - if 'p' in context.flags: - popen_kws['stdout'] = PIPE - popen_kws['stderr'] = PIPE - toggle_ui = False - pipe_output = True - context.wait = False - if 's' in context.flags: - devnull_writable = open(os.devnull, 'w') - devnull_readable = open(os.devnull, 'r') - for key in ('stdout', 'stderr'): - popen_kws[key] = devnull_writable - popen_kws['stdin'] = devnull_readable if 'f' in context.flags: toggle_ui = False context.wait = False - if 'w' in context.flags: - if not pipe_output and context.wait: # <-- sanity check - wait_for_enter = True if 'r' in context.flags: if 'sudo' not in get_executables(): return self._log("Can not run with 'r' flag, sudo is not installed!") |