From d6c78470ba0e3a9923d5cc13a5babaca4d52aecf Mon Sep 17 00:00:00 2001 From: hut Date: Wed, 15 Aug 2012 02:04:11 +0200 Subject: core.runner: removed 's', 'p', 'w' flags to behave like rifle instead of 's', you can append &>/dev/null instead of 'p', you can append |less instead of 'w', you can append ;read If there is demand, I'll add the flags back in. --- ranger/core/runner.py | 20 +------------------- 1 file changed, 1 insertion(+), 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!") -- cgit 1.4.1-2-gfad0