summary refs log blame commit diff stats
path: root/examples/plugin_hello_world.py
blob: be21d777b844e2585c82086e33d6ae5cb6d7617a (plain) (tree)
1
2
3
4
5
6
7
                                            
 


                                                                               
                                                                  
 





                                                                           
                                      

                                           

 
                   



                                                                             

                             


                                                                                
# 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
- valgrind - libstdc++-5-dev # default version is not valgrind-clean # test_layers takes a long time; divide up the work into multiple jobs on the # matrix so we don't time out on Travis matrix: include: - env: CXX=clang++ START=000 END=040 - env: CXX=clang++ START=040 END=055 - env: CXX=clang++ START=055 END=065 - env: CXX=clang++ START=065 END=070 - env: CXX=clang++ START=070 END=075 - env: CXX=clang++ START=075 END=080 - env: CXX=clang++ START=080 END=085 - env: CXX=clang++ START=085 END=090 - env: CXX=clang++ START=090 END=095 - env: CXX=clang++ START=095 END=999 # overflow; will start timing out if we add too many layers - env: CXX=clang++ START=chessboard - env: CXX=clang++ START=edit - env: CXX=clang++ START=edit2 - env: CXX=clang++ START=edit3 - env: CXX=clang++ START=edit4 - env: CXX=g++ START=one-off # minimal testing for gcc script: - ./test_layers $START $END notifications: email: on_success: never on_failure: always