diff options
author | nfnty <git@nfnty.se> | 2016-10-31 01:11:52 +0100 |
---|---|---|
committer | nfnty <git@nfnty.se> | 2016-10-31 01:34:41 +0100 |
commit | ba217830305c94545c2795f55488c12f21161fe1 (patch) | |
tree | 8b47d94f5e959ff0fe841516a7181ef5976ece03 /ranger | |
parent | 0476360b9c68ccf602c9d166b8dc99311f894405 (diff) | |
download | ranger-ba217830305c94545c2795f55488c12f21161fe1.tar.gz |
Always extend left side of `fm.log`
Diffstat (limited to 'ranger')
-rw-r--r-- | ranger/core/fm.py | 4 | ||||
-rw-r--r-- | ranger/core/main.py | 11 |
2 files changed, 7 insertions, 8 deletions
diff --git a/ranger/core/fm.py b/ranger/core/fm.py index 8168b7d6..5a435999 100644 --- a/ranger/core/fm.py +++ b/ranger/core/fm.py @@ -70,9 +70,9 @@ class FM(Actions, SignalDispatcher): self.hostname = socket.gethostname() self.home_path = os.path.expanduser('~') - self.log.append('ranger {0} started! Process ID is {1}.' + self.log.appendleft('ranger {0} started! Process ID is {1}.' .format(__version__, os.getpid())) - self.log.append('Running on Python ' + sys.version.replace('\n', '')) + self.log.appendleft('Running on Python ' + sys.version.replace('\n', '')) mimetypes.knownfiles.append(os.path.expanduser('~/.mime.types')) mimetypes.knownfiles.append(self.relpath('data/mime.types')) diff --git a/ranger/core/main.py b/ranger/core/main.py index 118a7480..93c71e81 100644 --- a/ranger/core/main.py +++ b/ranger/core/main.py @@ -112,7 +112,7 @@ def main(): if fm.username == 'root': fm.settings.preview_files = False fm.settings.use_preview_script = False - fm.log.append("Running as root, disabling the file previews.") + fm.log.appendleft("Running as root, disabling the file previews.") if not arg.debug: from ranger.ext import curses_interrupt_handler curses_interrupt_handler.install_interrupt_handler() @@ -313,12 +313,11 @@ def load_settings(fm, clean): else: module = importlib.import_module('plugins.' + plugin) fm.commands.load_commands_from_module(module) - fm.log.append("Loaded plugin '%s'." % plugin) - except Exception as e: - fm.log.append("Error in plugin '%s'" % plugin) + fm.log.appendleft("Loaded plugin '%s'." % plugin) + except Exception: import traceback - for line in traceback.format_exception_only(type(e), e): - fm.log.append(line) + fm.log.extendleft(reversed(traceback.format_exc().splitlines())) + fm.notify("Error in plugin '%s'" % plugin, bad=True) ranger.fm = None # COMPAT: Load the outdated options.py |