about summary refs log tree commit diff stats
path: root/html/linux/sigils.subx.html
Commit message (Expand)AuthorAgeFilesLines
* .Kartik Agaram2021-05-181-17/+17
* .Kartik Agaram2021-04-211-5/+5
* .Kartik Agaram2021-03-231-0/+4240
21 22:30:59 +0100 committer nfnty <git@nfnty.se> 2017-01-21 22:30:59 +0100 Python 3 division: Import `division` from `__future__`' href='/akspecs/ranger/commit/examples/plugin_hello_world.py?id=9f5eeff72146d3c5178d66b4879af7a6abfc22f1'>9f5eeff7 ^
e52629c1 ^
32a80ea7 ^





b3d031a9 ^
32a80ea7 ^

ab41c776 ^

32a80ea7 ^
d894fd02 ^



b3d031a9 ^

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
26
27
28
                                            
 


                                                                               
                                                                  
 





                                                                           
                                      

                                           

 
                   



                                                                             

                             


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

from __future__ import (absolute_import, division, print_function)

# 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:
HOOK_READY_OLD = 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 HOOK_READY_OLD(fm)


# Finally, "monkey patch" the existing hook_ready function with our replacement:
ranger.api.hook_ready = hook_ready