diff options
author | hut <hut@lavabit.com> | 2013-03-09 18:48:02 +0100 |
---|---|---|
committer | hut <hut@lavabit.com> | 2013-03-09 18:48:02 +0100 |
commit | d2c7d024290ee95afa418975c728ad64172dcfec (patch) | |
tree | eea0659eab7bb0c7b9cc2026468c840d7f22a5c9 /examples/plugin_chmod_keybindings.py | |
parent | 62af277734f05f27f20467393c9d997012ddd2b4 (diff) | |
download | ranger-d2c7d024290ee95afa418975c728ad64172dcfec.tar.gz |
move examples to doc/examples
Diffstat (limited to 'examples/plugin_chmod_keybindings.py')
-rw-r--r-- | examples/plugin_chmod_keybindings.py | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/examples/plugin_chmod_keybindings.py b/examples/plugin_chmod_keybindings.py deleted file mode 100644 index 0ab975ed..00000000 --- a/examples/plugin_chmod_keybindings.py +++ /dev/null @@ -1,20 +0,0 @@ -# Compatible with ranger 1.6.* -# -# This plugin serves as an example for adding key bindings through a plugin. -# It could replace the ten lines in the rc.conf that create the key bindings -# for the "chmod" command. - -import ranger.api -old_hook_init = ranger.api.hook_init - -def hook_init(fm): - old_hook_init(fm) - - # Generate key bindings for the chmod command - command = "map {0}{1}{2} shell -d chmod {1}{0}{2} %s" - for mode in list('ugoa') + ['']: - for perm in "rwxXst": - fm.execute_console(command.format('-', mode, perm)) - fm.execute_console(command.format('+', mode, perm)) - -ranger.api.hook_init = hook_init |