about summary refs log tree commit diff stats
path: root/src/LYForms.c
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>2019-05-26 00:22:52 +0000
committerThomas E. Dickey <dickey@invisible-island.net>2019-05-26 00:22:52 +0000
commitd96b72a7ccfc22e2684b78364d7a62886fc34201 (patch)
tree3564e60d6210187af236d28bc841691d26c156f0 /src/LYForms.c
parent01b7657ad896b176952ac2fddee0638a4123b3a8 (diff)
downloadlynx-snapshots-d96b72a7ccfc22e2684b78364d7a62886fc34201.tar.gz
snapshot of project "lynx", label v2-9-0dev_1a
Diffstat (limited to 'src/LYForms.c')
0 files changed, 0 insertions, 0 deletions
specs/ranger/blame/examples/plugin_hello_world.py?h=v1.9.2&id=58247b857f861c057158ec3ecab89f3dffcfe290'>^
32a80ea7 ^


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
                                            
 











                                                                               

 
                   




                                                                             


                                                                                
# Compatible with ranger 1.6.0 through 1.7.*
#
# 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