diff options
author | hut <hut@lavabit.com> | 2011-10-02 04:05:50 +0200 |
---|---|---|
committer | hut <hut@lavabit.com> | 2011-10-02 04:05:50 +0200 |
commit | fd24310233f24fe164343ab44171172543f40cd5 (patch) | |
tree | babaea39964f9fc8fab3f8ab028372d29baf96df /ranger | |
parent | b1a7fc1cc2b5b19ecf603b31ce23574f3ecf4657 (diff) | |
download | ranger-fd24310233f24fe164343ab44171172543f40cd5.tar.gz |
api.commands: fixed narg stuff
Diffstat (limited to 'ranger')
-rw-r--r-- | ranger/api/commands.py | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/ranger/api/commands.py b/ranger/api/commands.py index 9d2e60e9..4ea6ad1c 100644 --- a/ranger/api/commands.py +++ b/ranger/api/commands.py @@ -294,12 +294,15 @@ class FunctionCommand(Command): keywords['narg'] = self.quantifier try: - return self._based_function(*args, **keywords) - except TypeError: - try: - del keywords['narg'] + if self.quantifier is None: return self._based_function(*args, **keywords) - except TypeError: - self.fm.notify("Bad arguments for %s.%s: %s, %s" % - (self._object_name, self._function_name, - repr(args), repr(keywords)), bad=True) + else: + try: + return self._based_function(*args, **keywords) + except TypeError: + del keywords['narg'] + return self._based_function(*args, **keywords) + except TypeError: + self.fm.notify("Bad arguments for %s.%s: %s, %s" % + (self._object_name, self._function_name, + repr(args), repr(keywords)), bad=True) |