diff options
author | hut <hut@lavabit.com> | 2012-08-15 02:04:11 +0200 |
---|---|---|
committer | hut <hut@lavabit.com> | 2012-08-15 02:04:11 +0200 |
commit | d6c78470ba0e3a9923d5cc13a5babaca4d52aecf (patch) | |
tree | b43ee5923bca6070037b8723f9e79aa9fb28f656 | |
parent | bbd22fb344052b112f461b90fbb0d00e54996cff (diff) | |
download | ranger-d6c78470ba0e3a9923d5cc13a5babaca4d52aecf.tar.gz |
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.
-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!") |