From 8f343062c2eecea85fbd0a333b3bb1f121f00213 Mon Sep 17 00:00:00 2001 From: hut Date: Wed, 21 Mar 2012 10:55:38 +0100 Subject: ext.rifle: Trying to fix "No action found" error --- ranger/ext/rifle.py | 9 ++++++--- 1 file 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 -- cgit 1.4.1-2-gfad0