about summary refs log blame commit diff stats
path: root/js/magic-bird/imgs/extracted-1688-map/MapParts/hills/3.png
blob: db49775f55bb4726a007fb6adc57bd2112f6a27c (plain) (tree)
blob is binary.
2013-03-01 09:19:47 +0100 committer hut <hut@lavabit.com> 2013-03-01 09:22:59 +0100 Added version info to examples' href='/akspecs/ranger/commit/examples/plugin_hello_world.py?h=v1.9.0b5&id=c139ec86237c2800f55ea2064f18c1b5bc4e9523'>c139ec86 ^
32a80ea7 ^












d894fd02 ^




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.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