From 9b065d0ac7ea3a26f73146b33e087e1ad35980f3 Mon Sep 17 00:00:00 2001 From: hut Date: Fri, 15 Feb 2013 18:22:22 +0100 Subject: fsobject.directory.accept_file: pass directory, not dirname That way, the accept_file function can get whatever information about the directory it needs. --- examples/plugin_file_filter.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'examples') diff --git a/examples/plugin_file_filter.py b/examples/plugin_file_filter.py index 99d026bb..39e4e285 100644 --- a/examples/plugin_file_filter.py +++ b/examples/plugin_file_filter.py @@ -6,11 +6,11 @@ import ranger.fsobject.directory old_accept_file = ranger.fsobject.directory.accept_file # Define a new one -def custom_accept_file(fname, mypath, hidden_filter, name_filter): - if hidden_filter and mypath == '/' and fname in ('boot', 'sbin', 'proc', 'sys'): +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, mypath, hidden_filter, name_filter) + return old_accept_file(fname, directory, hidden_filter, name_filter) # Overwrite the old function import ranger.fsobject.directory -- cgit 1.4.1-2-gfad0