summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--README19
-rw-r--r--TODO2
-rw-r--r--ranger/__main__.py6
-rw-r--r--ranger/core/environment.py3
-rw-r--r--ranger/core/fm.py3
-rw-r--r--ranger/gui/widgets/console.py13
-rw-r--r--ranger/gui/widgets/statusbar.py8
-rw-r--r--ranger/shared/__init__.py7
8 files changed, 39 insertions, 22 deletions
diff --git a/README b/README
index 429aefa1..7d042929 100644
--- a/README
+++ b/README
@@ -124,6 +124,25 @@ Also, see the file HACKING for more detailed instructions on
 modifying the program.
 
 
+Roadmap
+-------
+
+Short term:
+
+* A cleaner and more flexible key configuration file
+* Performance improvements everywhere
+* Simplification of the code
+
+Long term:
+
+* One stable branch that you can rely on not crashing
+* A plugin system
+* Separate ranger into multiple programs:
+  1. One daemon running in the background for slow IO operations
+  2. A file launcher (ideally an already existing one)
+  3. The actual program containing unseparable parts
+
+
 Tips
 ----
 
diff --git a/TODO b/TODO
index 6be34f8c..715ebc1b 100644
--- a/TODO
+++ b/TODO
@@ -71,7 +71,7 @@ Bugs
    (X) #54  10/01/23  max_dirsize_for_autopreview not working
    ( ) #60  10/02/05  utf support improvable
    (X) #62  10/02/15  curs_set can raise an exception
-   (X) #65  10/02/16  "source ranger ranger some/file.txt" shouldn't cd after exit
+   ( ) #65  10/02/16  "source ranger ranger some/file.txt" shouldn't cd after exit
    (X) #67  10/03/08  terminal title in tty
    (X) #69  10/03/11  tab-completion breaks with Apps subclass
    (X) #73  10/03/21  when clicking on the first column, it goes 1x down
diff --git a/ranger/__main__.py b/ranger/__main__.py
index 863eadd5..2aae6343 100644
--- a/ranger/__main__.py
+++ b/ranger/__main__.py
@@ -75,7 +75,8 @@ def main():
 	from ranger.ext import curses_interrupt_handler
 	from ranger.core.fm import FM
 	from ranger.core.environment import Environment
-	from ranger.shared.settings import SettingsAware
+	from ranger.shared import (EnvironmentAware, FileManagerAware,
+			SettingsAware)
 	from ranger.gui.defaultui import DefaultUI as UI
 	from ranger.fsobject.file import File
 
@@ -111,12 +112,13 @@ def main():
 	else:
 		path = '.'
 
-	Environment(path)
+	EnvironmentAware._assign(Environment(path))
 	SettingsAware._setup_keys()
 
 	try:
 		my_ui = UI()
 		my_fm = FM(ui=my_ui)
+		FileManagerAware._assign(my_fm)
 
 		# Run the file manager
 		my_fm.initialize()
diff --git a/ranger/core/environment.py b/ranger/core/environment.py
index d83003b1..b712683a 100644
--- a/ranger/core/environment.py
+++ b/ranger/core/environment.py
@@ -63,9 +63,6 @@ class Environment(SettingsAware, SignalDispatcher):
 		self.hostname = socket.gethostname()
 		self.home_path = os.path.expanduser('~')
 
-		from ranger.shared import EnvironmentAware
-		EnvironmentAware.env = self
-
 		self.signal_bind('move', self._set_cf_from_signal, priority=0.1,
 				weak=True)
 
diff --git a/ranger/core/fm.py b/ranger/core/fm.py
index 459620c6..495b9f13 100644
--- a/ranger/core/fm.py
+++ b/ranger/core/fm.py
@@ -57,9 +57,6 @@ class FM(Actions, SignalDispatcher):
 		self.run = Runner(ui=self.ui, apps=self.apps,
 				logfunc=mylogfunc)
 
-		from ranger.shared import FileManagerAware
-		FileManagerAware.fm = self
-
 		self.log.append('Ranger {0} started! Process ID is {1}.' \
 				.format(__version__, os.getpid()))
 		self.log.append('Running on Python ' + sys.version.replace('\n',''))
diff --git a/ranger/gui/widgets/console.py b/ranger/gui/widgets/console.py
index 3228c511..c93a4f38 100644
--- a/ranger/gui/widgets/console.py
+++ b/ranger/gui/widgets/console.py
@@ -20,15 +20,20 @@ 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.container.keymap import CommandArgs
 from ranger.ext.get_executables import get_executables
+from ranger.ext.direction import Direction
+from ranger.container import History
+from ranger.container.history import HistoryEmptyException
 import ranger
 
 DEFAULT_HISTORY = 0
@@ -45,7 +50,6 @@ class _CustomTemplate(string.Template):
 class Console(Widget):
 	mode = None
 	visible = False
-	commandlist = None
 	last_cursor_mode = None
 	prompt = ':'
 	copy = ''
@@ -58,7 +62,6 @@ class Console(Widget):
 	historypaths = []
 
 	def __init__(self, win):
-		from ranger.container import History
 		Widget.__init__(self, win)
 		self.clear()
 		self.histories = []
@@ -195,7 +198,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 +387,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
@@ -419,6 +420,8 @@ class OpenConsole(ConsoleWithTab):
 
 	def init(self):
 		self.history = self.histories[OPEN_HISTORY]
+		OpenConsole.prompt = "{0}@{1} $ ".format(self.env.username,
+				self.env.hostname)
 
 	def execute(self):
 		command, flags = self._parse()
@@ -610,13 +613,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):
diff --git a/ranger/gui/widgets/statusbar.py b/ranger/gui/widgets/statusbar.py
index 78666a3d..caf5786e 100644
--- a/ranger/gui/widgets/statusbar.py
+++ b/ranger/gui/widgets/statusbar.py
@@ -145,10 +145,7 @@ class StatusBar(Widget):
 			target = self.column.target.pointed_obj
 		else:
 			target = self.env.at_level(0).pointed_obj
-
-		if target is None \
-				or not target.accessible \
-				or (target.is_directory and target.files is None):
+		if target is None or not target.accessible:
 			return
 
 		perms = target.get_permission_string()
@@ -204,9 +201,6 @@ class StatusBar(Widget):
 			return
 
 		target = self.column.target
-		if target is None:
-			return
-
 		if target is None \
 				or not target.accessible \
 				or (target.is_directory and target.files is None):
diff --git a/ranger/shared/__init__.py b/ranger/shared/__init__.py
index a476bd5f..048b9e7a 100644
--- a/ranger/shared/__init__.py
+++ b/ranger/shared/__init__.py
@@ -20,9 +20,16 @@ class Awareness(object):
 
 class EnvironmentAware(Awareness):
 	env = None
+	@staticmethod
+	def _assign(instance):
+		EnvironmentAware.env = instance
+
 
 class FileManagerAware(Awareness):
 	fm = None
+	@staticmethod
+	def _assign(instance):
+		FileManagerAware.fm = instance
 
 from .mimetype import MimeTypeAware
 from .settings import SettingsAware
o Silva <silvino@bk.ru> 2018-04-03 02:12:08 +0100 committer Silvino Silva <silvino@bk.ru> 2018-04-03 02:12:08 +0100 dev c lib and index revision' href='/punk/doc/commit/dev/c/lib.html?id=7867e4ea5ca255b610d69a4f47d45083717ac542'>7867e4e ^
77fe64b ^
7867e4e ^

77fe64b ^
7867e4e ^
77fe64b ^
7867e4e ^

77fe64b ^
7867e4e ^
77fe64b ^
7867e4e ^


77fe64b ^
7867e4e ^
77fe64b ^
7867e4e ^


77fe64b ^
7867e4e ^



77fe64b ^
7867e4e ^
























77fe64b ^
7867e4e ^







































77fe64b ^
7867e4e ^
77fe64b ^
7867e4e ^


































































214aa23 ^
7867e4e ^
855557f ^
7867e4e ^

77fe64b ^

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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255