summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2010-04-14 00:15:50 +0200
committerhut <hut@lavabit.com>2010-04-14 00:15:50 +0200
commite07d8797bf8b1029205f48e65241a4819768f310 (patch)
tree88b0a7b5b05e90f3da93c6948bbf8f9dbeece039 /ranger
parentb34fd133e7172194d9faf73e9c1b8a2bb97ec90e (diff)
downloadranger-e07d8797bf8b1029205f48e65241a4819768f310.tar.gz
console: move imports to top level
Diffstat (limited to 'ranger')
-rw-r--r--ranger/gui/widgets/console.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/ranger/gui/widgets/console.py b/ranger/gui/widgets/console.py
index 0da5cba3..8480ea42 100644
--- a/ranger/gui/widgets/console.py
+++ b/ranger/gui/widgets/console.py
@@ -20,14 +20,18 @@ commands, searching and executing files.
 
 import string
 import curses
+import re
 from collections import deque
 
 from . import Widget
 from ranger.defaults import commands
 from ranger.gui.widgets.console_mode import is_valid_mode, mode_to_class
 from ranger import log, relpath_conf
+from ranger.core.runner import ALLOWED_FLAGS
 from ranger.ext.shell_escape import shell_quote
 from ranger.ext.get_executables import get_executables
+from ranger.container import CommandList, History
+from ranger.container.history import HistoryEmptyException
 import ranger
 
 DEFAULT_HISTORY = 0
@@ -57,7 +61,6 @@ class Console(Widget):
 	historypaths = []
 
 	def __init__(self, win):
-		from ranger.container import CommandList, History
 		Widget.__init__(self, win)
 		self.commandlist = CommandList()
 		self.settings.keys.initialize_console_commands(self.commandlist)
@@ -155,7 +158,6 @@ class Console(Widget):
 		self.line = ''
 
 	def press(self, key):
-		from curses.ascii import ctrl, ESC
 
 		keytuple = self.env.keybuffer.tuple_with_numbers()
 		try:
@@ -197,7 +199,6 @@ class Console(Widget):
 		self.on_line_change()
 
 	def history_move(self, n):
-		from ranger.container.history import HistoryEmptyException
 		try:
 			current = self.history.current()
 		except HistoryEmptyException:
@@ -385,7 +386,6 @@ class SearchConsole(Console):
 		self.history = self.histories[SEARCH_HISTORY]
 
 	def execute(self):
-		import re
 		if self.fm.env.cwd:
 			regexp = re.compile(self.line, re.L | re.U | re.I)
 			self.fm.env.last_search = regexp
@@ -612,13 +612,11 @@ class QuickOpenConsole(ConsoleWithTab):
 
 		return None
 
-
 	def _is_app(self, arg):
 		return self.fm.apps.has(arg) or \
 			(not self._is_flags(arg) and arg in get_executables())
 
 	def _is_flags(self, arg):
-		from ranger.core.runner import ALLOWED_FLAGS
 		return all(x in ALLOWED_FLAGS for x in arg)
 
 	def _is_mode(self, arg):
f07bb12fc5c59430e995a64956b36331ce3629b9'>f07bb12f ^
4c13e1f2 ^
f07bb12f ^





















4c13e1f2 ^
f07bb12f ^
34a60763 ^
f07bb12f ^


62cd83ba ^

f07bb12f ^






4c13e1f2 ^

f07bb12f ^


4c13e1f2 ^

f07bb12f ^



4c13e1f2 ^


f07bb12f ^











f07bb12f ^















4c13e1f2 ^




34a60763 ^
4c13e1f2 ^
34a60763 ^
4c13e1f2 ^



f07bb12f ^
62cd83ba ^
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
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
138
139
140
141
142
143
144
145