summary refs log tree commit diff stats
path: root/doc/examples/plugin_hello_world.py
diff options
context:
space:
mode:
authorhut <hut@lepus.uberspace.de>2015-04-14 01:46:12 +0200
committerhut <hut@lepus.uberspace.de>2015-04-14 01:46:12 +0200
commiteb9a75caa91f9315d14b17db14af4dfdd71fa82e (patch)
tree26e2d4002756a20666c6a2e6f8d148aafc990afe /doc/examples/plugin_hello_world.py
parent09b0f2f1044025c8d14d5f7296f43b495cf75ec3 (diff)
parent89146651e07830f15b59b5f076d61741747a0bea (diff)
downloadranger-1.7.0-emacs.tar.gz
Merge branch 'master' into emacs v1.7.0-emacs
Diffstat (limited to 'doc/examples/plugin_hello_world.py')
-rw-r--r--doc/examples/plugin_hello_world.py23
1 files changed, 0 insertions, 23 deletions
diff --git a/doc/examples/plugin_hello_world.py b/doc/examples/plugin_hello_world.py
deleted file mode 100644
index a803e21b..00000000
--- a/doc/examples/plugin_hello_world.py
+++ /dev/null
@@ -1,23 +0,0 @@
-# Compatible with ranger 1.6.*
-#
-# This is a sample plugin that displays "Hello World" in ranger's console after
-# it started.
-
-# We are going to extend the hook "ranger.api.hook_ready", so first we need
-# to import ranger.api:
-import ranger.api
-
-# Save the previously existing hook, because maybe another module already
-# extended that hook and we don't want to lose it:
-old_hook_ready = ranger.api.hook_ready
-
-# Create a replacement for the hook that...
-def hook_ready(fm):
-    # ...does the desired action...
-    fm.notify("Hello World")
-    # ...and calls the saved hook.  If you don't care about the return value,
-    # simply return the return value of the previous hook to be safe.
-    return old_hook_ready(fm)
-
-# Finally, "monkey patch" the existing hook_ready function with our replacement:
-ranger.api.hook_ready = hook_ready