summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2011-09-28 23:19:52 +0200
committerhut <hut@lavabit.com>2011-09-28 23:19:52 +0200
commit0da832e8c47261fed2e91463699f6505ba3269fa (patch)
treee115359fb27b7b5497fbc95995b02d85ea9c333f
parentdc27af1255a285bc5387e00dc459f55043a4c092 (diff)
downloadranger-0da832e8c47261fed2e91463699f6505ba3269fa.tar.gz
shortened ranger.py
-rwxr-xr-xranger.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/ranger.py b/ranger.py
index f4962093..0991b451 100755
--- a/ranger.py
+++ b/ranger.py
@@ -34,7 +34,7 @@ return 1
 """
 
 import sys
-import os.path
+from os.path import exists, normpath, abspath
 
 # Need to find out whether or not the flag --clean was used ASAP,
 # because --clean is supposed to disable bytecode compilation
@@ -45,11 +45,8 @@ sys.dont_write_bytecode = '-c' in argv or '--clean' in argv
 __doc__ = """Ranger - file browser for the unix terminal"""
 
 # Don't import ./ranger when running an installed binary at /usr/bin/ranger
-if os.path.exists('ranger') and '/' in os.path.normpath(__file__):
-	try:
-		sys.path.remove(os.path.abspath('.'))
-	except:
-		pass
+if exists('ranger') and '/' in normpath(__file__) and abspath('.') in sys.path:
+	sys.path.remove(abspath('.'))
 
 # Start ranger
 import ranger
ame the previous revision' href='/akspecs/ranger/blame/README?h=v1.4.2&id=0d15a7cb155df52bfde44b13407d565738d20898'>^
712aa449
0a32b684 ^
cfcfd885 ^
712aa449
4ea0f69a ^


712aa449
0a32b684 ^

4ad365fc ^
0a32b684 ^
2144cf26 ^
36e4e71e ^

4ea0f69a ^

36e4e71e ^




78a7d762 ^
36e4e71e ^

78a7d762 ^
36e4e71e ^


4ea0f69a ^

36e4e71e ^
bd088c49 ^
36e4e71e ^
0a32b684 ^
36e4e71e ^

f6ae504c ^
4ea0f69a ^

0a32b684 ^

4ea0f69a ^
0a32b684 ^
4ea0f69a ^


0a32b684 ^

4ea0f69a ^



36e4e71e ^
7582555b ^
36e4e71e ^
7582555b ^








36e4e71e ^
4ea0f69a ^


36e4e71e ^




4ea0f69a ^
e71c8103 ^

36e4e71e ^

f6ae504c ^
4ea0f69a ^
36e4e71e ^

4ea0f69a ^

36e4e71e ^






4ea0f69a ^

306c76d8 ^






b6aff4c3 ^

306c76d8 ^
4ea0f69a ^

45cf5174 ^












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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137