about summary refs log tree commit diff stats
path: root/examples/plugin_pmount.py
Commit message (Expand)AuthorAgeFilesLines
* linting: pylint: Enable `broad-except`, Improve loggingnfnty2017-01-211-16/+13
* Python 3 division: Import `division` from `__future__`nfnty2017-01-211-1/+1
* linting: Python 2 compat: Import from `__future__`nfnty2017-01-171-0/+2
* linting: pylint and flake8nfnty2017-01-171-3/+8
* linting: autopep8nfnty2017-01-171-4/+10
* Add two blank lines where is expectedstepshal2016-06-161-0/+2
* Add plugin_pmount.pyWojciech Siewierski2015-10-091-0/+30
anger/commit/examples/plugin_linemode.py?id=1bcb5c9c4b6396f935cfd46e6ad38f7a295fab43'>1bcb5c9c ^
ab41c776 ^
1bcb5c9c ^


dded3cb8 ^
916c2390 ^

b3d031a9 ^
916c2390 ^
b3d031a9 ^
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