summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2013-02-15 18:34:44 +0100
committerhut <hut@lavabit.com>2013-02-15 18:34:57 +0100
commita471b6e1a778112c857a10093c6ccf16070ed1e2 (patch)
tree2cde9a27bf2588374d996aa466d244deac58b191 /ranger
parent9b065d0ac7ea3a26f73146b33e087e1ad35980f3 (diff)
downloadranger-a471b6e1a778112c857a10093c6ccf16070ed1e2.tar.gz
fsobject.directory: check for temporary_filter
this can be used in commands which temporarily filter the directory,
without disrupting the user-defined filter.
Diffstat (limited to 'ranger')
-rw-r--r--ranger/fsobject/directory.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/ranger/fsobject/directory.py b/ranger/fsobject/directory.py
index a71b00a9..0c4f10bd 100644
--- a/ranger/fsobject/directory.py
+++ b/ranger/fsobject/directory.py
@@ -41,6 +41,8 @@ def accept_file(fname, directory, hidden_filter, name_filter):
         return False
     if name_filter and name_filter not in fname:
         return False
+    if directory.temporary_filter and not directory.temporary_filter.search(fname):
+        return False
     return True
 
 class Directory(FileSystemObject, Accumulator, Loadable, SettingsAware):
@@ -54,6 +56,7 @@ class Directory(FileSystemObject, Accumulator, Loadable, SettingsAware):
     filenames = None
     files = None
     filter = None
+    temporary_filter = None
     marked_items = None
     scroll_begin = 0
 
160' href='#n160'>160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218