summary refs log tree commit diff stats
path: root/examples/plugin_linemode.py
blob: 52b9c60a29ba6da44f1f2e7fe9fd1d6f3d894de3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# 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.

from __future__ import (absolute_import, division, print_function)

import codecs

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


@ranger.api.register_linemode
class MyLinemode(LinemodeBase):
    name = "rot13"

    def filetitle(self, fobj, metadata):
        return codecs.encode(fobj.relative_path, "rot_13")

    def infostring(self, fobj, metadata):
        raise NotImplementedError
03388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
[MASTER]
init-hook='import sys; sys.path.append("tests/pylint")'
load-plugins=py2_compat

[BASIC]
good-names=i,j,k,n,x,y,ex,Run,_,fm,ui,fg,bg
bad-names=foo,baz,toto,tutu,tata

[DESIGN]
max-args=6
max-branches=16

[FORMAT]
max-line-length = 99
enable=no-absolute-import,old-division
disable=cyclic-import,duplicate-code,fixme,import-outside-toplevel,locally-disabled,locally-enabled,missing-docstring,no-else-break,no-else-continue,no-else-raise,no-else-return,raise-missing-from,redefined-variable-type,stop-iteration-return,super-with-arguments,useless-object-inheritance

[TYPECHECK]
ignored-classes=ranger.core.actions.Actions