summary refs log blame commit diff stats
path: root/examples/plugin_linemode.py
blob: 8a92552ebb6d58e93946c0272ec9a3e26f59510f (plain) (tree)
1
2
3
4
5
6
7
8
9
10
pre { line-height: 125%; }
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
.highlight .hll {
# Compatible since ranger 1.7.0
#
# This sample plugin adds a new linemode displaying the filename in rot13.
# Load this plugin by copying it to ~/.config/ranger/plugins/ and activate
# the linemode by typing ":linemode rot13" in ranger.  Type Mf to restore
# the default linemode.

import codecs
import ranger.api
from ranger.core.linemode import LinemodeBase

@ranger.api.register_linemode
class MyLinemode(LinemodeBase):
    name = "rot13"
    def filetitle(self, file, metadata):
        return codecs.encode(file.relative_path, "rot_13")
s2">"$1 is not running" ;; 4) echo "Unable to determine the program status" ;; esac } case $1 in start) $SSD --start --pidfile $PID_WIFI --exec $PROG_WIFI -- $OPTS_WIFI && \ $SSD --start --pidfile $PID_DHCP --exec $PROG_DHCP -- $OPTS_DHCP RETVAL=$? ;; stop) ( $SSD --stop --retry 10 --pidfile $PID_DHCP $SSD --stop --retry 10 --pidfile $PID_WIFI ) RETVAL=$? ;; restart) $0 stop $0 start ;; status) print_status $PROG_WIFI $PID_WIFI print_status $PROG_DHCP $PID_DHCP ;; *) echo "Usage: $0 [start|stop|restart|status]" ;; esac exit $RETVAL # End of file