summary refs log tree commit diff stats
path: root/examples/plugin_file_filter.py
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2013-03-09 18:48:02 +0100
committerhut <hut@lavabit.com>2013-03-09 18:48:02 +0100
commitd2c7d024290ee95afa418975c728ad64172dcfec (patch)
treeeea0659eab7bb0c7b9cc2026468c840d7f22a5c9 /examples/plugin_file_filter.py
parent62af277734f05f27f20467393c9d997012ddd2b4 (diff)
downloadranger-d2c7d024290ee95afa418975c728ad64172dcfec.tar.gz
move examples to doc/examples
Diffstat (limited to 'examples/plugin_file_filter.py')
-rw-r--r--examples/plugin_file_filter.py19
1 files changed, 0 insertions, 19 deletions
diff --git a/examples/plugin_file_filter.py b/examples/plugin_file_filter.py
deleted file mode 100644
index 965fa2e8..00000000
--- a/examples/plugin_file_filter.py
+++ /dev/null
@@ -1,19 +0,0 @@
-# Compatible with ranger 1.6.*
-#
-# This plugin hides the directories "boot", "sbin", "proc" and "sys" in the
-# root directory.
-
-# Save the original filter function
-import ranger.fsobject.directory
-old_accept_file = ranger.fsobject.directory.accept_file
-
-# Define a new one
-def custom_accept_file(fname, directory, hidden_filter, name_filter):
-       if hidden_filter and directory.path == '/' and fname in ('boot', 'sbin', 'proc', 'sys'):
-               return False
-       else:
-               return old_accept_file(fname, directory, hidden_filter, name_filter)
-
-# Overwrite the old function
-import ranger.fsobject.directory
-ranger.fsobject.directory.accept_file = custom_accept_file
c2c9c182bcaca8f93e'>c912b731 ^
f716d791 ^









f716d791 ^
f716d791 ^

f716d791 ^


















f716d791 ^









f716d791 ^
f716d791 ^













11f7f7b8 ^

f716d791 ^

11f7f7b8 ^

5763322b ^
5763322b ^
11f7f7b8 ^
5763322b ^
11f7f7b8 ^

5763322b ^
11f7f7b8 ^
f898ee7a ^
11f7f7b8 ^
f716d791 ^

11f7f7b8 ^

f716d791 ^
11f7f7b8 ^
f716d791 ^

41302404 ^

f716d791 ^



5763322b ^


f0f16bdf ^
f716d791 ^
5763322b ^
f716d791 ^
53172ce1 ^
f716d791 ^


41302404 ^

f716d791 ^
5763322b ^
f716d791 ^



ecbdc925 ^
f716d791 ^












ecbdc925 ^
f716d791 ^




11f7f7b8 ^
f716d791 ^











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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165