diff options
-rw-r--r-- | examples/plugin_ipc.py | 1 | ||||
-rw-r--r-- | examples/plugin_linemode.py | 1 | ||||
-rw-r--r-- | ranger/api/commands.py | 2 | ||||
-rw-r--r-- | ranger/colorschemes/jungle.py | 1 | ||||
-rwxr-xr-x | ranger/config/commands.py | 6 | ||||
-rw-r--r-- | ranger/core/actions.py | 5 | ||||
-rw-r--r-- | ranger/core/fm.py | 1 | ||||
-rw-r--r-- | ranger/core/loader.py | 3 | ||||
-rw-r--r-- | ranger/core/main.py | 1 | ||||
-rw-r--r-- | ranger/ext/cached_function.py | 1 | ||||
-rw-r--r-- | ranger/ext/signals.py | 2 | ||||
-rw-r--r-- | ranger/gui/widgets/pager.py | 1 | ||||
-rw-r--r-- | tests/ranger/container/test_bookmarks.py | 2 |
13 files changed, 27 insertions, 0 deletions
diff --git a/examples/plugin_ipc.py b/examples/plugin_ipc.py index a9e79205..cfb546fa 100644 --- a/examples/plugin_ipc.py +++ b/examples/plugin_ipc.py @@ -22,6 +22,7 @@ def hook_init(fm): import thread except ImportError: import _thread as thread + def ipc_reader(filepath): while True: with open(filepath, 'r') as fifo: diff --git a/examples/plugin_linemode.py b/examples/plugin_linemode.py index 8a92552e..be34e6c5 100644 --- a/examples/plugin_linemode.py +++ b/examples/plugin_linemode.py @@ -12,5 +12,6 @@ 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") diff --git a/ranger/api/commands.py b/ranger/api/commands.py index c3e0a59a..b463a776 100644 --- a/ranger/api/commands.py +++ b/ranger/api/commands.py @@ -377,6 +377,7 @@ class FunctionCommand(Command): _based_function = None _object_name = "" _function_name = "unknown" + def execute(self): if not self._based_function: return @@ -431,6 +432,7 @@ class AliasCommand(Command): _object_name = "" _function_name = "unknown" _line = "" + def execute(self): return self._make_cmd().execute() diff --git a/ranger/colorschemes/jungle.py b/ranger/colorschemes/jungle.py index 6a9c3c52..a142cd4f 100644 --- a/ranger/colorschemes/jungle.py +++ b/ranger/colorschemes/jungle.py @@ -6,6 +6,7 @@ from ranger.colorschemes.default import Default class Scheme(Default): progress_bar_color = green + def use(self, context): fg, bg, attr = Default.use(self, context) diff --git a/ranger/config/commands.py b/ranger/config/commands.py index e09e1f10..e98a32a3 100755 --- a/ranger/config/commands.py +++ b/ranger/config/commands.py @@ -340,6 +340,7 @@ class set_(Command): Use `:set <option>!` to toggle or cycle it, e.g. `:set flush_input!` """ name = 'set' # don't override the builtin set class + def execute(self): name = self.arg(1) name, value, _, toggle = self.parse_setting_line_v2() @@ -380,6 +381,7 @@ class setlocal(set_): Gives an option a new value. """ PATH_RE = re.compile(r'^\s*path="?(.*?)"?\s*$') + def execute(self): import os.path match = self.PATH_RE.match(self.arg(1)) @@ -605,6 +607,7 @@ class load_copy_buffer(Command): Load the copy buffer from confdir/copy_buffer """ copy_buffer_filename = 'copy_buffer' + def execute(self): from ranger.container.file import File from os.path import exists @@ -626,6 +629,7 @@ class save_copy_buffer(Command): Save the copy buffer to confdir/copy_buffer """ copy_buffer_filename = 'copy_buffer' + def execute(self): fname = None try: @@ -964,6 +968,7 @@ class help_(Command): Display ranger's manual page. """ name = 'help' + def execute(self): def callback(answer): if answer == "q": @@ -1400,6 +1405,7 @@ class prompt_metadata(Command): _command_name = "meta" _console_chain = None + def execute(self): prompt_metadata._console_chain = self.args[1:] self._process_command_stack() diff --git a/ranger/core/actions.py b/ranger/core/actions.py index a39cef21..c7e0909e 100644 --- a/ranger/core/actions.py +++ b/ranger/core/actions.py @@ -967,6 +967,7 @@ class Actions(FileManagerAware, SettingsAware): path, str(width), str(height), cacheimg, str(self.settings.preview_images)], read=True, silent=True, descr="Getting preview of %s" % path) + def on_after(signal): exit = signal.process.poll() content = signal.loader.stdout_buffer @@ -1012,6 +1013,7 @@ class Actions(FileManagerAware, SettingsAware): else: pager.set_source(self.thisfile.get_preview_source( pager.wid, pager.hei)) + def on_destroy(signal): try: del self.previews[path] @@ -1164,6 +1166,7 @@ class Actions(FileManagerAware, SettingsAware): contexts = 'browser', 'console', 'pager', 'taskview' temporary_file = tempfile.NamedTemporaryFile() + def write(string): temporary_file.write(string.encode('utf-8')) @@ -1189,6 +1192,7 @@ class Actions(FileManagerAware, SettingsAware): def dump_commands(self): temporary_file = tempfile.NamedTemporaryFile() + def write(string): temporary_file.write(string.encode('utf-8')) @@ -1214,6 +1218,7 @@ class Actions(FileManagerAware, SettingsAware): def dump_settings(self): temporary_file = tempfile.NamedTemporaryFile() + def write(string): temporary_file.write(string.encode('utf-8')) diff --git a/ranger/core/fm.py b/ranger/core/fm.py index 052584a6..c6736485 100644 --- a/ranger/core/fm.py +++ b/ranger/core/fm.py @@ -235,6 +235,7 @@ class FM(Actions, SignalDispatcher): return import shutil from errno import EEXIST + def copy(_from, to): if os.path.exists(self.confpath(to)): sys.stderr.write("already exists: %s\n" % self.confpath(to)) diff --git a/ranger/core/loader.py b/ranger/core/loader.py index b1aabb53..9cdd9ea2 100644 --- a/ranger/core/loader.py +++ b/ranger/core/loader.py @@ -20,6 +20,7 @@ except: class Loadable(object): paused = False progressbar_supported = False + def __init__(self, gen, descr): self.load_generator = gen self.description = descr @@ -43,6 +44,7 @@ class Loadable(object): class CopyLoader(Loadable, FileManagerAware): progressbar_supported = True + def __init__(self, copy_buffer, do_cut=False, overwrite=False): self.copy_buffer = tuple(copy_buffer) self.do_cut = do_cut @@ -137,6 +139,7 @@ class CommandLoader(Loadable, SignalDispatcher, FileManagerAware): """ finished = False process = None + def __init__(self, args, descr, silent=False, read=False, input=None, kill_on_pause=False, popenArgs=None): SignalDispatcher.__init__(self) diff --git a/ranger/core/main.py b/ranger/core/main.py index 2972a1eb..8bfd33b8 100644 --- a/ranger/core/main.py +++ b/ranger/core/main.py @@ -72,6 +72,7 @@ def main(): sys.stderr.write("Warning: Using ranger as a file launcher is " "deprecated.\nPlease use the standalone file launcher " "'rifle' instead.\n") + def print_function(string): print(string) from ranger.ext.rifle import Rifle diff --git a/ranger/ext/cached_function.py b/ranger/ext/cached_function.py index bce2b5ca..31f49271 100644 --- a/ranger/ext/cached_function.py +++ b/ranger/ext/cached_function.py @@ -3,6 +3,7 @@ def cached_function(fnc): cache = {} + def inner_cached_function(*args): try: return cache[args] diff --git a/ranger/ext/signals.py b/ranger/ext/signals.py index bcac66fe..a361e8ac 100644 --- a/ranger/ext/signals.py +++ b/ranger/ext/signals.py @@ -71,6 +71,7 @@ class Signal(dict): To delete a signal handler from inside a signal, raise a ReferenceError. """ stopped = False + def __init__(self, **keywords): dict.__init__(self, keywords) self.__dict__ = self @@ -90,6 +91,7 @@ class SignalHandler: "active" to False. """ active = True + def __init__(self, signal_name, function, priority, pass_signal): self._priority = max(0, min(1, priority)) self._signal_name = signal_name diff --git a/ranger/gui/widgets/pager.py b/ranger/gui/widgets/pager.py index 0d185f98..9b9cb74b 100644 --- a/ranger/gui/widgets/pager.py +++ b/ranger/gui/widgets/pager.py @@ -20,6 +20,7 @@ class Pager(Widget): need_clear_image = False need_redraw_image = False max_width = None + def __init__(self, win, embedded=False): Widget.__init__(self, win) self.embedded = embedded diff --git a/tests/ranger/container/test_bookmarks.py b/tests/ranger/container/test_bookmarks.py index 46c615c6..af8aab23 100644 --- a/tests/ranger/container/test_bookmarks.py +++ b/tests/ranger/container/test_bookmarks.py @@ -36,8 +36,10 @@ def testbookmarks(tmpdir): # We don't uneccesary update when the file on disk does not change origupdate = secondstore.update + class OutOfDateException(Exception): pass + def crash(): raise OutOfDateException("Don't access me") secondstore.update = crash |