summary refs log tree commit diff stats
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
parent630884165a8af388983eb39c0976f58506d1a0ea (diff)
downloadranger-14f6e996305933d2a37d02c3a3ed87dc4a66b5e3.tar.gz
core.actions: macros: `confdir` should not be defined in clean mode
Fixes #758
-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):
ef='/akkartik/mu/commit/subx/examples/ex7.subx?h=main&id=294a15206329d2992df073622fb5ce2c1e96001b'>294a1520 ^
ecfbbfb5 ^
33352536 ^

ecfbbfb5 ^
62c6d163 ^
ecfbbfb5 ^
33352536 ^


ecfbbfb5 ^
3364d19c ^
33352536 ^

62c6d163 ^
ecfbbfb5 ^
9d27e966 ^
33352536 ^

9d27e966 ^
33352536 ^

ecfbbfb5 ^
62c6d163 ^
ecfbbfb5 ^
9d27e966 ^
33352536 ^

9d27e966 ^
ecfbbfb5 ^
6ff9ce26 ^
ecfbbfb5 ^
33352536 ^


ecfbbfb5 ^
9d27e966 ^
33352536 ^

6ff9ce26 ^
ecfbbfb5 ^
9d27e966 ^
33352536 ^

9d27e966 ^
33352536 ^

ecfbbfb5 ^
6ff9ce26 ^
ecfbbfb5 ^
9d27e966 ^
33352536 ^

3364d19c ^
ecfbbfb5 ^
6ff9ce26 ^
ecfbbfb5 ^
33352536 ^
ecfbbfb5 ^
6ff9ce26 ^
ecfbbfb5 ^
9d27e966 ^
33352536 ^

3364d19c ^
ecfbbfb5 ^
6ff9ce26 ^
ecfbbfb5 ^
e5cbbea4 ^
e59a91b7 ^
9b16f190 ^
e59a91b7 ^
9b16f190 ^
e59a91b7 ^
9b16f190 ^
e59a91b7 ^
6030d7e2 ^
9b16f190 ^
6ff9ce26 ^
ee9a9237 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98