summary refs log tree commit diff stats
diff options
context:
space:
mode:
authornfnty <git@nfnty.se>2017-04-11 21:21:08 +0200
committernfnty <git@nfnty.se>2017-04-11 21:26:32 +0200
commitfffd0c056ebf0378308cd47f7f690d20663e3c95 (patch)
treee32a0941130b50c5274dc5d21543b87c14e1dc7c
parent305537963bb1db5b3e50213c46749f62bb84bc9a (diff)
downloadranger-fffd0c056ebf0378308cd47f7f690d20663e3c95.tar.gz
container.settings: Log nonexistent `preview_script`
Related to #849
-rw-r--r--ranger/container/settings.py1
-rw-r--r--ranger/core/actions.py12
2 files changed, 5 insertions, 8 deletions
diff --git a/ranger/container/settings.py b/ranger/container/settings.py
index 0367e699..b58165ca 100644
--- a/ranger/container/settings.py
+++ b/ranger/container/settings.py
@@ -147,6 +147,7 @@ class Settings(SignalDispatcher, FileManagerAware):
                 if os.path.exists(result):
                     signal.value = result
                 else:
+                    self.fm.notify("Preview script `{0}` doesn't exist!".format(result), bad=True)
                     signal.value = None
 
         elif name == 'use_preview_script':
diff --git a/ranger/core/actions.py b/ranger/core/actions.py
index cf5dc02e..3b30fe6b 100644
--- a/ranger/core/actions.py
+++ b/ranger/core/actions.py
@@ -1006,17 +1006,13 @@ class Actions(  # pylint: disable=too-many-instance-attributes,too-many-public-m
         try:
             stat_ = os.stat(self.settings.preview_script)
         except OSError:
-            self.fm.notify(
-                "Preview Script `%s' doesn't exist!" % self.settings.preview_script,
-                bad=True,
-            )
+            self.fm.notify("Preview script `{0}` doesn't exist!".format(
+                self.settings.preview_script), bad=True)
             return None
 
         if not stat_.st_mode & S_IEXEC:
-            self.fm.notify(
-                "Preview Script `%s' is not executable!" % self.settings.preview_script,
-                bad=True,
-            )
+            self.fm.notify("Preview script `{0}` is not executable!".format(
+                self.settings.preview_script), bad=True)
             return None
 
         data['loading'] = True