diff options
author | nfnty <git@nfnty.se> | 2017-01-23 22:18:00 +0100 |
---|---|---|
committer | nfnty <git@nfnty.se> | 2017-01-23 22:18:00 +0100 |
commit | 14f6e996305933d2a37d02c3a3ed87dc4a66b5e3 (patch) | |
tree | 8d8d926f2025fed50426f68fbdaf806f818b14f4 | |
parent | 630884165a8af388983eb39c0976f58506d1a0ea (diff) | |
download | ranger-14f6e996305933d2a37d02c3a3ed87dc4a66b5e3.tar.gz |
core.actions: macros: `confdir` should not be defined in clean mode
Fixes #758
-rw-r--r-- | ranger/core/actions.py | 3 | ||||
-rw-r--r-- | ranger/core/fm.py | 8 |
2 files changed, 5 insertions, 6 deletions
diff --git a/ranger/core/actions.py b/ranger/core/actions.py index 2d5f2da0..23f58173 100644 --- a/ranger/core/actions.py +++ b/ranger/core/actions.py @@ -272,7 +272,8 @@ class Actions( # pylint: disable=too-many-instance-attributes,too-many-public-m macros = {} macros['rangerdir'] = ranger.RANGERDIR - macros['confdir'] = self.fm.confpath() + if not ranger.args.clean: + macros['confdir'] = self.fm.confpath() macros['space'] = ' ' if self.fm.thisfile: diff --git a/ranger/core/fm.py b/ranger/core/fm.py index f524bbc4..7ad2cbdf 100644 --- a/ranger/core/fm.py +++ b/ranger/core/fm.py @@ -298,11 +298,9 @@ class FM(Actions, # pylint: disable=too-many-instance-attributes @staticmethod def confpath(*paths): - """returns the path relative to rangers configuration directory""" - if ranger.args.clean: - assert 0, "Should not access relpath_conf in clean mode!" - else: - return os.path.join(ranger.args.confdir, *paths) + """returns path to ranger's configuration directory""" + assert not ranger.args.clean, "Accessed configuration directory in clean mode" + return os.path.join(ranger.args.confdir, *paths) @staticmethod def relpath(*paths): |