summary refs log tree commit diff stats
path: root/doc/pydoc/ranger.ext.html
Commit message (Expand)AuthorAgeFilesLines
* incremented version number and updated pydoc html files v1.0.3hut2010-02-161-5/+8
* updated pydoc documentationhut2010-01-131-5/+6
* updated pydoc documentationhut2010-01-021-1/+4
* moved pydoc pages to doc/pydochut2009-12-251-0/+29
n_hello_world.py?h=v1.9.0&id=32a80ea727d940a5f359a135a4b8d83b77fa0bca'>32a80ea7 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

                              












                                                                               




                                                                             


                                                                                
# 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