summary refs log blame commit diff stats
path: root/ranger.py
blob: cfac83c3a0a848f8fe0a9112d5d161d1af98013f (plain) (tree)
1
2
3
4
5
6
7




                     

                                                                 






                                                                                
           

                                 

                                                     
            
                                           
                                     
                                                  

                                                     
 
                                            



                                       


                                               
 
                                    

                                 
#!/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.dummy()
		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()