about summary refs log tree commit diff stats
path: root/ranger.py
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2009-11-27 10:49:48 +0100
committerhut <hut@lavabit.com>2009-11-27 10:49:48 +0100
commit9506fb8e79f2d04a1ab78039bacdbee7b22109b5 (patch)
tree3d5c682e9c5032a1c23be6a98c9d3d6e7c8224b5 /ranger.py
parent5822dff7d91472bf2fc337c68f144e0ce1de09ae (diff)
downloadranger-9506fb8e79f2d04a1ab78039bacdbee7b22109b5.tar.gz
more VROOM
Diffstat (limited to 'ranger.py')
-rwxr-xr-xranger.py38
1 files changed, 38 insertions, 0 deletions
diff --git a/ranger.py b/ranger.py
new file mode 100755
index 00000000..65388727
--- /dev/null
+++ b/ranger.py
@@ -0,0 +1,38 @@
+#!/usr/bin/python
+# coding=utf-8
+
+# TODO: cd after exit
+
+from ranger import debug, fm, options, environment, command, keys
+from ranger.defaultui import DefaultUI as UI
+
+# TODO: find out the real name of this script and include files relative to here
+
+# TODO: Parse arguments
+
+# TODO: load config
+
+def main():
+	import locale, os
+	os.stat_float_times(True)
+	locale.setlocale(locale.LC_ALL, 'en_US.utf8')
+
+	try:
+		path = os.path.abspath('.')
+		opt = options.get()
+		env = environment.Environment(opt)
+		commandlist = command.CommandList()
+		keys.initialize_commands(commandlist)
+
+		my_ui = UI(env, commandlist)
+		my_fm = fm.FM(env)
+		my_fm.feed(path, my_ui)
+		my_fm.run()
+
+	except BaseException as original_error:
+		try: my_ui.exit()
+		except: pass
+
+		raise original_error
+
+if __name__ == "__main__": main()