diff options
author | hut <hut@lavabit.com> | 2012-03-21 10:55:38 +0100 |
---|---|---|
committer | hut <hut@lavabit.com> | 2012-03-21 10:55:38 +0100 |
commit | 8f343062c2eecea85fbd0a333b3bb1f121f00213 (patch) | |
tree | 475e94e9fab4aab6252c477e4742df3c7a46cd40 /ranger | |
parent | 0dc911f084724af8e5a64508656c9d1ba3d3c38b (diff) | |
download | ranger-8f343062c2eecea85fbd0a333b3bb1f121f00213.tar.gz |
ext.rifle: Trying to fix "No action found" error
Diffstat (limited to 'ranger')
-rwxr-xr-x | ranger/ext/rifle.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/ranger/ext/rifle.py b/ranger/ext/rifle.py index ea2a489c..f2dacf79 100755 --- a/ranger/ext/rifle.py +++ b/ranger/ext/rifle.py @@ -245,6 +245,7 @@ class Rifle(object): the "p" flag is negated and the "f" flag is added, resulting in "wf". """ command = None + found_at_least_one = None # Determine command for count, cmd, lbl, flags in self.list_commands(files, mimetype): @@ -252,13 +253,15 @@ class Rifle(object): cmd = self.hook_command_preprocessing(cmd) command = self._build_command(files, cmd, flags) break + else: + found_at_least_one = True # Execute command if command is None: - if count <= 0 or way <= 0: - self.hook_logger("No action found.") - else: + if found_at_least_one: self.hook_logger("Method number %d is undefined." % way) + else: + self.hook_logger("No action found.") else: if 'PAGER' not in os.environ: os.environ['PAGER'] = DEFAULT_PAGER |