summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2013-02-10 02:51:13 +0100
committerhut <hut@lavabit.com>2013-02-10 02:51:13 +0100
commit184e84284d2f4e48631a4b94b87ba76126470206 (patch)
tree9233b3c7826e469de878f5456bde23656643bdcb
parent2f518f737769b9e8fd97651d4bbc64d89b4b4865 (diff)
downloadranger-184e84284d2f4e48631a4b94b87ba76126470206.tar.gz
core.actions: Warn about missing or non-executable scope.sh
-rw-r--r--ranger/core/actions.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/ranger/core/actions.py b/ranger/core/actions.py
index 5ffe315e..491f22af 100644
--- a/ranger/core/actions.py
+++ b/ranger/core/actions.py
@@ -10,6 +10,7 @@ import tempfile
 from os.path import join, isdir, realpath, exists
 from os import link, symlink, getcwd, listdir, stat
 from inspect import cleandoc
+from stat import S_IEXEC
 
 import ranger
 from ranger.ext.direction import Direction
@@ -817,9 +818,22 @@ class Actions(FileManagerAware, EnvironmentAware, SettingsAware):
 				if data['loading']:
 					return None
 
+
 			found = data.get((-1, -1), data.get((width, -1),
 				data.get((-1, height), data.get((width, height), False))))
 			if found == False:
+				try:
+					stat_ = os.stat(self.settings.preview_script)
+				except:
+					self.fm.notify("Preview Script `%s' doesn't exist!" %
+							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)
+					return None
+
 				data['loading'] = True
 				loadable = CommandLoader(args=[self.settings.preview_script,
 					path, str(width), str(height)], read=True,
hut@lavabit.com> 2010-04-19 23:43:48 +0200 committer hut <hut@lavabit.com> 2010-04-19 23:43:48 +0200 updated pydoc' href='/akspecs/ranger/commit/doc/pydoc/ranger.ext.html?h=v1.2.0&id=c9383c72b2f62bee90050d02a307381cb6bfa536'>c9383c72 ^
edf3d9f8 ^


62cd83ba ^
3e18db75 ^
edf3d9f8 ^
ef0157ff ^
edf3d9f8 ^

a614f048 ^
f07bb12f ^

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39