diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/README | 3 | ||||
-rw-r--r-- | examples/plugin_file_filter.py | 6 |
2 files changed, 6 insertions, 3 deletions
diff --git a/examples/README b/examples/README index 8606a89d..7c71d9cf 100644 --- a/examples/README +++ b/examples/README @@ -1,2 +1,5 @@ The files in this directory contain applications or extensions of ranger which are put here for your inspiration and as references. + +In order to use a plugin from this directory, you need to copy it to +~/.config/ranger/plugins/ 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 |