summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authornfnty <git@nfnty.se>2017-01-23 22:18:00 +0100
committernfnty <git@nfnty.se>2017-01-23 22:18:00 +0100
commit14f6e996305933d2a37d02c3a3ed87dc4a66b5e3 (patch)
tree8d8d926f2025fed50426f68fbdaf806f818b14f4 /ranger
parent630884165a8af388983eb39c0976f58506d1a0ea (diff)
downloadranger-14f6e996305933d2a37d02c3a3ed87dc4a66b5e3.tar.gz
core.actions: macros: `confdir` should not be defined in clean mode
Fixes #758
Diffstat (limited to 'ranger')
-rw-r--r--ranger/core/actions.py3
-rw-r--r--ranger/core/fm.py8
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):