summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2010-03-21 03:35:00 +0100
committerhut <hut@lavabit.com>2010-03-21 03:35:00 +0100
commit6c867217763b0527776bad87493d4b950287caf0 (patch)
tree314f286c884f904a52ce2fd6414d9733c35713e7
parentd15755718a8615accfa995186c53515739e38c00 (diff)
downloadranger-6c867217763b0527776bad87493d4b950287caf0.tar.gz
gui.widgets.console: removed warning after typing >cd
-rw-r--r--ranger/gui/widgets/console.py34
1 files changed, 15 insertions, 19 deletions
diff --git a/ranger/gui/widgets/console.py b/ranger/gui/widgets/console.py
index f9e4924c..feb54a3d 100644
--- a/ranger/gui/widgets/console.py
+++ b/ranger/gui/widgets/console.py
@@ -293,26 +293,17 @@ class CommandConsole(ConsoleWithTab):
 			self.close()
 
 	def _get_cmd(self):
-		command_class = self._get_cmd_class()
-		if command_class:
-			return command_class(self.line, self.mode)
-		else:
-			return None
-
-	def _get_cmd_class(self):
 		try:
-			command_name = self.line.split()[0]
-		except IndexError:
-			return None
-
-		try:
-			return commands.get_command(command_name)
+			command_class = self._get_cmd_class()
 		except KeyError:
 			self.fm.notify("Invalid command! Press ? for help.", bad=True)
+		except:
 			return None
-		except ValueError as e:
-			self.fm.notify(e)
-			return None
+		else:
+			return command_class(self.line, self.mode)
+
+	def _get_cmd_class(self):
+		return commands.get_command(self.line.split()[0])
 
 	def _get_tab(self):
 		if ' ' in self.line:
@@ -340,9 +331,14 @@ class QuickCommandConsole(CommandConsole):
 	"""
 	prompt = '>'
 	def on_line_change(self):
-		cmd = self._get_cmd()
-		if cmd and cmd.quick_open():
-			self.execute(cmd)
+		try:
+			cls = self._get_cmd_class()
+		except (KeyError, ValueError, IndexError):
+			pass
+		else:
+			cmd = cls(self.line, self.mode)
+			if cmd and cmd.quick_open():
+				self.execute(cmd)
 
 
 class SearchConsole(Console):
aabc157e5db00e42302d495bba432c0'>a4cadf78 ^
a7a28506 ^
a2726b6a ^

a7a28506 ^
a7a28506 ^
a48df401 ^
055a5f71 ^
6d39f49f ^
a2726b6a ^
a2c62117 ^
a2726b6a ^
a7a28506 ^
a2c62117 ^


0e2fbeb3 ^
8ebc1d4a ^
0e2fbeb3 ^
055a5f71 ^
a48df401 ^
a7a28506 ^

a2726b6a ^

a7a28506 ^
a7a28506 ^
a48df401 ^
055a5f71 ^
6d39f49f ^
a2726b6a ^
a2c62117 ^
a2726b6a ^
0e2fbeb3 ^
a2c62117 ^


0e2fbeb3 ^
8ebc1d4a ^
a7a28506 ^
055a5f71 ^
a48df401 ^
a7a28506 ^

a2726b6a ^

a7a28506 ^
a7a28506 ^
a48df401 ^
055a5f71 ^
6d39f49f ^
a2726b6a ^
a2c62117 ^
a2726b6a ^
a7a28506 ^
a2c62117 ^


0e2fbeb3 ^
8ebc1d4a ^
0e2fbeb3 ^
055a5f71 ^
a48df401 ^
a7a28506 ^
5afb296e ^
a2726b6a ^

95ad5643 ^
a48df401 ^
055a5f71 ^
6d39f49f ^
95ad5643 ^
a2726b6a ^

95ad5643 ^
a2726b6a ^
95ad5643 ^
51bd4ed3 ^
a2726b6a ^
055a5f71 ^

8aba52f4 ^
a2726b6a ^
95ad5643 ^
9bd2315d ^
95ad5643 ^
055a5f71 ^
95ad5643 ^
a48df401 ^
95ad5643 ^
f180925c ^
a2726b6a ^

f180925c ^
055a5f71 ^
6d39f49f ^
f180925c ^
51bd4ed3 ^

f180925c ^

8aba52f4 ^
f180925c ^
a2726b6a ^

f180925c ^


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