about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--ranger/__init__.py6
-rw-r--r--ranger/__main__.py2
-rw-r--r--ranger/applications.py6
3 files changed, 9 insertions, 5 deletions
diff --git a/ranger/__init__.py b/ranger/__init__.py
index 264aa931..4dfec83a 100644
--- a/ranger/__init__.py
+++ b/ranger/__init__.py
@@ -2,6 +2,9 @@
 import os
 import sys
 
+# for easier access
+from ranger.ext.debug import log, trace
+
 __copyright__ = 'none'
 __license__ = 'GPL'
 __version__ = '1.0.0'
@@ -17,7 +20,4 @@ sys.path.append(CONFDIR)
 
 USAGE = '''%s [options] [path/filename]'''
 
-# for easier access
-from ranger.ext.debug import log, trace
-
 from ranger.__main__ import main
diff --git a/ranger/__main__.py b/ranger/__main__.py
index 200d856b..c821a23c 100644
--- a/ranger/__main__.py
+++ b/ranger/__main__.py
@@ -76,4 +76,6 @@ def main():
 			except: pass
 
 if __name__ == '__main__':
+	top_dir = os.path.dirname(sys.path[0])
+	sys.path.insert(0, top_dir)
 	main()
diff --git a/ranger/applications.py b/ranger/applications.py
index 4c329a05..beefba9f 100644
--- a/ranger/applications.py
+++ b/ranger/applications.py
@@ -6,6 +6,10 @@ p: redirect output to the pager
 
 An uppercase key ensures that a certain flag will not be used.
 """
+
+import os, sys
+from ranger.ext.waitpid_no_intr import waitpid_no_intr
+
 ALLOWED_FLAGS = 'sdpSDP'
 
 class Applications(object):
@@ -24,14 +28,12 @@ class Applications(object):
 		"""Returns a list with all application functions"""
 		return [x[4:] for x in self.__class__.__dict__ if x.startswith('app_')]
 
-import os, sys
 null = open(os.devnull, 'a')
 
 def run(*args, **kw):
 	"""Run files with the specified parameters"""
 	from subprocess import Popen
 	from subprocess import PIPE
-	from ranger.ext.waitpid_no_intr import waitpid_no_intr
 
 	flags, fm = kw['flags'], kw['fm']
 	for flag in flags:
alt'>
4ea0f69a ^

240394a4 ^
e952d6cb ^
36e4e71e ^

4a383291 ^
78a7d762 ^
e952d6cb ^
78a7d762 ^
e952d6cb ^
4ea0f69a ^

7838675f ^

240394a4 ^
7838675f ^



755e7df1 ^
7838675f ^
500cf259 ^



bf14a7e7 ^
240394a4 ^




























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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86