diff options
author | toonn <toonn@toonn.io> | 2018-08-23 21:43:21 +0200 |
---|---|---|
committer | toonn <toonn@toonn.io> | 2018-09-06 15:20:54 +0200 |
commit | 07cc58396035d1c25871632d8ee14cad08dbe69a (patch) | |
tree | 870d1e9e0b4ee8090945fb7c6fa4e6a8f8b73dc0 /ranger | |
parent | 0ae55822c4f353438d548a4ee63185a59702ccd2 (diff) | |
download | ranger-07cc58396035d1c25871632d8ee14cad08dbe69a.tar.gz |
Fixed up pylint/flake8 warnings
Diffstat (limited to 'ranger')
-rw-r--r-- | ranger/core/actions.py | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/ranger/core/actions.py b/ranger/core/actions.py index 4ee69504..73c9fa51 100644 --- a/ranger/core/actions.py +++ b/ranger/core/actions.py @@ -240,19 +240,21 @@ class Actions( # pylint: disable=too-many-instance-attributes,too-many-public-m cmd = cmd_class(string, quantifier=quantifier) if cmd.resolve_macros and _MacroTemplate.delimiter in cmd.line: - f1 = lambda i, c: ('any{:d}'.format(i), key_to_string(c)) - def f2(i, c): + def any_macro(i, char): + return ('any{:d}'.format(i), key_to_string(char)) + + def anypath_macro(i, char): try: - val = self.fm.bookmarks[key_to_string(c)] + val = self.fm.bookmarks[key_to_string(char)] except KeyError: self.notify('No bookmark defined for `{}`'.format( - key_to_string(c)), bad=True) + key_to_string(char)), bad=True) val = MACRO_FAIL return ('any_path{:d}'.format(i), val) - macros = dict(f(i, char) for f in (f1, f2) for i, char - in enumerate(wildcards if wildcards - is not None else [])) + macros = dict(f(i, char) for f in (any_macro, anypath_macro) + for i, char in enumerate(wildcards if wildcards + is not None else [])) if 'any0' in macros: macros['any'] = macros['any0'] if 'any_path0' in macros: |