diff options
author | hut <hut@lavabit.com> | 2012-08-09 05:53:05 +0200 |
---|---|---|
committer | hut <hut@lavabit.com> | 2012-08-09 05:53:05 +0200 |
commit | 9d46272c353bc0f00a04d1c8b4b1d72085e92eec (patch) | |
tree | ce4e22518ae2a54b71fa93f68f83440ad2446157 | |
parent | 9dd669c7339442a38e87d0954efd7da6aaf258a1 (diff) | |
download | ranger-9d46272c353bc0f00a04d1c8b4b1d72085e92eec.tar.gz |
ext.rifle: silenced output of forked programs
-rwxr-xr-x | ranger/ext/rifle.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/ranger/ext/rifle.py b/ranger/ext/rifle.py index 12da48f1..feef4cac 100755 --- a/ranger/ext/rifle.py +++ b/ranger/ext/rifle.py @@ -341,8 +341,13 @@ class Rifle(object): cmd = [exe] + prefix + [command] else: cmd = prefix + [command] - p = Popen(cmd, env=self.hook_environment(os.environ)) - if not ('f' in flags or 't' in flags): + if 'f' in flags or 't' in flags: + devnull_r = open(os.devnull, 'r') + devnull_w = open(os.devnull, 'w') + p = Popen(cmd, env=self.hook_environment(os.environ), + stdin=devnull_r, stdout=devnull_w, stderr=devnull_w) + else: + p = Popen(cmd, env=self.hook_environment(os.environ)) p.wait() finally: self.hook_after_executing(command, self._mimetype, self._app_flags) |