summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2010-04-14 00:24:10 +0200
committerhut <hut@lavabit.com>2010-04-14 00:24:10 +0200
commit04ce666a809f461db7477edc7884beb4d466deff (patch)
tree1c6785fe6a989e723781e2bcce9426a60123b2a5
parentdaa224d86348f0e0fa39d09feef43e34df56d780 (diff)
parent19c1fa4f622ffd1597943f0005ba58a30b170bb4 (diff)
downloadranger-04ce666a809f461db7477edc7884beb4d466deff.tar.gz
Merge branch 'devel' into newkey
Conflicts:
	ranger/__main__.py
	ranger/defaults/keys.py
	ranger/gui/widgets/console.py
-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