summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2012-08-02 03:15:19 +0200
committerhut <hut@lavabit.com>2012-08-02 03:19:33 +0200
commit71598234b87dc0a2930a495764e1316ecec83754 (patch)
treed3085cc252cdb453a8b9e7fbf6d2c56fe6c9e1d6 /ranger
parente5978d9ed9ffb3382e23a56c9f8f03544109b2aa (diff)
downloadranger-71598234b87dc0a2930a495764e1316ecec83754.tar.gz
defaults.options: type of hidden_filter changed from regexp to string
Diffstat (limited to 'ranger')
-rw-r--r--ranger/defaults/options.py3
-rw-r--r--ranger/fsobject/directory.py14
2 files changed, 13 insertions, 4 deletions
diff --git a/ranger/defaults/options.py b/ranger/defaults/options.py
index 5e30f042..c2d1fe57 100644
--- a/ranger/defaults/options.py
+++ b/ranger/defaults/options.py
@@ -25,8 +25,7 @@ column_ratios = (1, 3, 4)
 
 # Which files should be hidden?  Toggle this by typing `zh' or
 # changing the setting `show_hidden'
-hidden_filter = regexp(
-	r'^\.|\.(?:pyc|pyo|bak|swp)$|^lost\+found$|^__(py)?cache__$')
+hidden_filter = r'^\.|\.(?:pyc|pyo|bak|swp)$|^lost\+found$|^__(py)?cache__$'
 show_hidden = False
 
 # Which script is used to generate file previews?
diff --git a/ranger/fsobject/directory.py b/ranger/fsobject/directory.py
index 1abd6ddd..e6909fbb 100644
--- a/ranger/fsobject/directory.py
+++ b/ranger/fsobject/directory.py
@@ -2,6 +2,7 @@
 # This software is distributed under the terms of the GNU GPL version 3.
 
 import os.path
+import re
 from os import stat as os_stat, lstat as os_lstat
 from collections import deque
 from time import time
@@ -173,8 +174,17 @@ class Directory(FileSystemObject, Accumulator, Loadable, SettingsAware):
 
 				self.mount_path = mount_path(mypath)
 
-				hidden_filter = not self.settings.show_hidden \
-						and self.settings.hidden_filter
+				if not self.settings.show_hidden and self.settings.hidden_filter:
+					# COMPAT
+					# hidden_filter used to be a regex, not a string.  If an
+					# old config is used, we don't need to re.compile it.
+					if hasattr(self.settings.hidden_filter, 'search'):
+						hidden_filter = self.settings.hidden_filter
+					else:
+						hidden_filter = re.compile(self.settings.hidden_filter)
+				else:
+					hidden_filter = None
+
 				filelist = os.listdir(mypath)
 
 				if self._cumulative_size_calculated:
t'>
97aebb61 ^

9b177a9e ^
732533ee ^
9b177a9e ^
732533ee ^


0a57c4de ^






a234ba0c ^

3fdd9944 ^
2ce43b63 ^



3b2ceee8 ^
44d16e91 ^
2900bf4a ^
4ec005e4 ^
bb6540f7 ^
b6b7dd5a ^
f831f657 ^
c814cb44 ^
af42bc44 ^


9b3593bd ^
af42bc44 ^
6fd5b617 ^
945d6559 ^
36427971 ^
3a778cc9 ^
3bc92750 ^
3d1299eb ^
2ce43b63 ^
1b0ce852 ^
4aee5347 ^
630fef01 ^
630fef01 ^
28dd5458 ^




14f25992 ^


4aee5347 ^
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