summary refs log tree commit diff stats
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
parentb34fd133e7172194d9faf73e9c1b8a2bb97ec90e (diff)
downloadranger-e07d8797bf8b1029205f48e65241a4819768f310.tar.gz
console: move imports to top level
-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):
1fb ^
1076f2b
650a1fb ^
1076f2b

650a1fb ^
1076f2b
eff4478 ^
1076f2b
7b5638f ^

98c6a92 ^
98c6a92 ^

02cea3b ^
7b5638f ^
2b66f7a ^
98c6a92 ^
7b5638f ^
1076f2b

dc5c070 ^

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
                            
                            
                                                                  

 

            
                                                     



            

                                                               
 
                                                                   




                      
           
           
                                                                  
 
            
 
                                                             

                                                        
                              
 
                                                        
 

                                                                
 

              
                                            
               
              
 
 

             

                                                              
d='n50' href='#n50'>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