From b3d031a913814900467358b2adf20a148bf6de1a Mon Sep 17 00:00:00 2001 From: nfnty Date: Wed, 21 Dec 2016 05:06:55 +0100 Subject: linting: pylint and flake8 --- examples/plugin_pmount.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'examples/plugin_pmount.py') diff --git a/examples/plugin_pmount.py b/examples/plugin_pmount.py index fe0adffb..6cd325f7 100644 --- a/examples/plugin_pmount.py +++ b/examples/plugin_pmount.py @@ -15,7 +15,8 @@ MOUNT_KEY = 'm' UMOUNT_KEY = 'M' LIST_MOUNTS_KEY = 'N' -old_hook_init = ranger.api.hook_init + +HOOK_INIT_OLD = ranger.api.hook_init def hook_init(fm): @@ -33,6 +34,10 @@ def hook_init(fm): ) fm.execute_console("map {key}{0}{1} chain cd; shell pumount sd{0}{1}".format( disk, part, key=UMOUNT_KEY)) - finally: - return old_hook_init(fm) + except Exception: + pass + + return HOOK_INIT_OLD(fm) + + ranger.api.hook_init = hook_init -- cgit 1.4.1-2-gfad0