summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2010-03-29 20:10:20 +0200
committerhut <hut@lavabit.com>2010-03-29 20:10:20 +0200
commit45cf5174fef40415ac270a6c64a388a8994dcff9 (patch)
tree7710c43adbe1b57be87d4fa5e717a2efdf33c28f /ranger
parente71c8103458d9f1ae3cad73ff3d97876ca5a58a8 (diff)
downloadranger-45cf5174fef40415ac270a6c64a388a8994dcff9.tar.gz
removed the cd-after-exit hack
Fear not. You still get the same functionality by using a function like:

ranger() {
    $(which ranger) $@ &&
    cd "$(grep \^\' ~/.ranger/bookmarks | cut -b3-)"
}
Diffstat (limited to 'ranger')
-rw-r--r--ranger/__init__.py2
-rw-r--r--ranger/__main__.py14
-rw-r--r--ranger/core/fm.py1
3 files changed, 1 insertions, 16 deletions
diff --git a/ranger/__init__.py b/ranger/__init__.py
index d1300cb4..f46a1e76 100644
--- a/ranger/__init__.py
+++ b/ranger/__init__.py
@@ -34,7 +34,7 @@ USAGE = '%prog [options] [path/filename]'
 DEFAULT_CONFDIR = '~/.ranger'
 RANGERDIR = os.path.dirname(__file__)
 LOGFILE = '/tmp/errorlog'
-arg = OpenStruct(cd_after_exit=False,
+arg = OpenStruct(
 		debug=False, clean=False, confdir=DEFAULT_CONFDIR,
 		mode=0, flags='', targets=[])
 
diff --git a/ranger/__main__.py b/ranger/__main__.py
index 9b932bd3..32f28e12 100644
--- a/ranger/__main__.py
+++ b/ranger/__main__.py
@@ -29,13 +29,6 @@ def parse_arguments():
 
 	parser = OptionParser(usage=USAGE, version='ranger ' + __version__)
 
-	# Instead of using this directly, use the embedded
-	# shell script by running ranger with:
-	# source /path/to/ranger /path/to/ranger
-	parser.add_option('--cd-after-exit',
-			action='store_true',
-			help=SUPPRESS_HELP)
-
 	parser.add_option('-d', '--debug', action='store_true',
 			help="activate debug mode")
 
@@ -58,9 +51,6 @@ def parse_arguments():
 
 	arg.confdir = os.path.expanduser(arg.confdir)
 
-	if arg.cd_after_exit:
-		sys.stderr = sys.__stdout__
-
 	if not arg.clean:
 		try:
 			os.makedirs(arg.confdir)
@@ -133,7 +123,6 @@ def main():
 	try:
 		my_ui = UI()
 		my_fm = FM(ui=my_ui)
-		my_fm.stderr_to_out = arg.cd_after_exit
 
 		# Run the file manager
 		my_fm.initialize()
@@ -143,9 +132,6 @@ def main():
 		# Finish, clean up
 		if 'my_ui' in vars():
 			my_ui.destroy()
-		if arg.cd_after_exit:
-			try: sys.__stderr__.write(my_fm.env.cwd.path)
-			except: pass
 
 if __name__ == '__main__':
 	top_dir = os.path.dirname(sys.path[0])
diff --git a/ranger/core/fm.py b/ranger/core/fm.py
index 994447b0..94d0d85d 100644
--- a/ranger/core/fm.py
+++ b/ranger/core/fm.py
@@ -35,7 +35,6 @@ TICKS_BEFORE_COLLECTING_GARBAGE = 100
 class FM(Actions):
 	input_blocked = False
 	input_blocked_until = 0
-	stderr_to_out = False
 	def __init__(self, ui=None, bookmarks=None, tags=None):
 		"""Initialize FM."""
 		Actions.__init__(self)