diff options
author | Wojciech Siewierski <wojciech.siewierski@onet.pl> | 2015-03-12 22:39:28 +0100 |
---|---|---|
committer | hut <hut@lepus.uberspace.de> | 2015-03-18 19:30:44 +0100 |
commit | 33e173fdf5840f3cd808d073eb35be22638b9ff8 (patch) | |
tree | bed0baa152b9d14cb6c2c07c7da32a1b37b0ed06 | |
parent | b9f906067b778e0d6f042c3035a79352a027e81b (diff) | |
download | ranger-33e173fdf5840f3cd808d073eb35be22638b9ff8.tar.gz |
the register_linemode function reimplemented as a decorator
-rw-r--r-- | ranger/api/__init__.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/ranger/api/__init__.py b/ranger/api/__init__.py index cc0815c2..67ff8bc4 100644 --- a/ranger/api/__init__.py +++ b/ranger/api/__init__.py @@ -29,8 +29,7 @@ def hook_ready(fm): from ranger.core.linemode import LinemodeBase -def register_linemode(*linemodes): - """Register the linemodes in a dictionary of the available linemodes.""" +def custom_linemode(linemode_class): from ranger.container.fsobject import FileSystemObject - for linemode in linemodes: - FileSystemObject.linemode_dict[linemode.name] = linemode() + FileSystemObject.linemode_dict[linemode_class.name] = linemode_class() + return linemode_class |