about summary refs log tree commit diff stats
Commit message (Expand)AuthorAgeFilesLines
...
* 3391 - type abbreviations everywhereKartik K. Agaram2016-09-1724-3256/+3256
* 3390Kartik K. Agaram2016-09-1733-240/+240
* 3389Kartik K. Agaram2016-09-1745-713/+720
* 3388Kartik K. Agaram2016-09-176-56/+56
* 3387Kartik K. Agaram2016-09-171-31/+31
* 3386Kartik K. Agaram2016-09-177-93/+93
* 3385Kartik K. Agaram2016-09-1730-858/+858
* 3384Kartik K. Agaram2016-09-171-0/+14
* 3383Kartik K. Agaram2016-09-172-4/+4
* 3382Kartik K. Agaram2016-09-171-5/+5
* 3381Kartik K. Agaram2016-09-1725-131/+131
* 3380Kartik K. Agaram2016-09-1743-854/+855
* 3379Kartik K. Agaram2016-09-1732-407/+407
* 3378Kartik K. Agaram2016-09-171-3/+2
* 3377Kartik K. Agaram2016-09-176-49/+49
* 3376 - start maximally using all type abbreviationsKartik K. Agaram2016-09-176-31/+31
* 3375Kartik K. Agaram2016-09-172-4/+5
* 3374Kartik K. Agaram2016-09-1615-62/+62
* 3373Kartik K. Agaram2016-09-161-1/+2
* 3372Kartik K. Agaram2016-09-161-7/+9
* 3371Kartik K. Agaram2016-09-1612-89/+173
* 3370Kartik K. Agaram2016-09-161-4/+5
* 3369Kartik K. Agaram2016-09-152-24/+0
* 3368Kartik K. Agaram2016-09-152-15/+4
* 3367Kartik K. Agaram2016-09-151-8/+24
* 3366Kartik K. Agaram2016-09-151-1/+1
* 3365 - create strings out of arbitrary typesKartik K. Agaram2016-09-153-3/+72
* 3364Kartik K. Agaram2016-09-154-9/+17
* 3363 - bugfix in tangleKartik K. Agaram2016-09-152-1/+12
* 3362Kartik K. Agaram2016-09-151-3/+3
* 3361Kartik K. Agaram2016-09-151-7/+7
* 3360Kartik K. Agaram2016-09-151-1/+1
* 3359Kartik K. Agaram2016-09-151-10/+9
* 3358Kartik K. Agaram2016-09-152-0/+9
* 3357 - multi-ary 'append'Kartik K. Agaram2016-09-151-33/+36
* 3356Kartik K. Agaram2016-09-151-10/+10
* 3355Kartik K. Agaram2016-09-1549-980/+1704
* 3354 - support multiple routines at a source/sinkKartik K. Agaram2016-09-152-13/+40
* 3353Kartik K. Agaram2016-09-152-7/+65
* 3352Kartik K. Agaram2016-09-141-72/+72
* 3351 - new but incomplete synchronization setupKartik K. Agaram2016-09-142-48/+101
* 3350Kartik K. Agaram2016-09-142-3/+7
* 3349Kartik K. Agaram2016-09-141-2/+6
* 3348Kartik K. Agaram2016-09-141-4/+20
* 3347Kartik K. Agaram2016-09-134-8/+8
* 3346Kartik K. Agaram2016-09-133-9/+14
* 3345Kartik K. Agaram2016-09-121-1/+1
* 3344Kartik K. Agaram2016-09-123-6/+8
* 3343Kartik K. Agaram2016-09-124-35/+54
* 3342Kartik K. Agaram2016-09-121-1/+8
m.py?h=v1.9.0&id=f027adc08ce0d15717c7694956f23ff637553543'>^
e6dfc442 ^



3ea48208 ^


d494f019 ^
3ea48208 ^


d494f019 ^
e6dfc442 ^


d494f019 ^
3ea48208 ^

dd7a4f63 ^
419e4aa5 ^




dd7a4f63 ^
65cb1a32 ^

3d566884 ^
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
                      

                                                                

                         
                 
                                                       
                                      
                            
                                                     

                                                                  

                      

                                                 
                           
                            
                                                                   



                                                            
                                                      

                                     







                                          









                                                                         
 


                                


                                  


                                        













                                                                     


                                          

                                        
        



                                                          


                                             


                                          
 












                                                                      
                            


                                                              
 



                                                  


                                                                           
                                                  


                                                                                
                                   


                                                               
 

                                
 




                                            
                                                

                                                               
 
from os import devnull
#from ranger.conf.apps import CustomApplications as Applications
from ranger.conf import apps
null = open(devnull, 'a')

class FM(object):
	def __init__(self, environment, ui, bookmarks):
		self.env = environment
		self.ui = ui
		self.apps = apps.CustomApplications()
		self.bookmarks = bookmarks
		self.bookmarks.enter_dir_function = self.enter_dir

	def run(self):
		self.env.enter_dir(self.env.path)

		while True:
			try:
				self.bookmarks.reload_if_outdated()
				self.ui.draw()
				key = self.ui.get_next_key()
				self.ui.press(key, self)
			except KeyboardInterrupt:
				self.ui.press(3, self)
			except:
				raise
	
	def interrupt(self):
		import time
		self.env.key_clear()
		try:
			time.sleep(0.2)
		except KeyboardInterrupt:
			raise SystemExit()
	
	def search_forward(self):
		if self.env.pwd:
			if self.env.pwd.search(self.env.last_search):
				self.env.cf = self.env.pwd.pointed_file

	def search_backward(self):
		if self.env.pwd:
			if self.env.pwd.search(self.env.last_search, -1):
				self.env.cf = self.env.pwd.pointed_file

	def resize(self):
		self.ui.resize()

	def exit(self):
		raise SystemExit()

	def enter_dir(self, path):
		self.env.enter_dir(path)

	def enter_bookmark(self, key):
		from ranger.bookmark import NonexistantBookmark
		try:
			destination = self.bookmarks[key]
			current_path = self.env.pwd.path
			if destination != current_path:
				self.bookmarks.enter(key)
				self.bookmarks.remember(current_path)
		except NonexistantBookmark:
			pass

	def set_bookmark(self, key):
		self.bookmarks[key] = self.env.pwd.path

	def unset_bookmark(self, key):
		self.bookmarks.delete(key)

	def move_left(self):
		self.env.enter_dir('..')
	
	def move_right(self, mode = 0):
		cf = self.env.cf
		if not self.env.enter_dir(cf):
			self.execute_file(cf, mode = mode)

	def history_go(self, relative):
		self.env.history_go(relative)
	
	def handle_mouse(self):
		self.ui.handle_mouse(self)

	def execute_file(self, files, app = '', flags = '', mode = 0):
		if type(files) not in (list, tuple):
			files = [files]

		self.apps.get(app)(
				mainfile = files[0],
				files = files,
				flags = flags,
				mode = mode,
				fm = self,
				stdin = None,
				apps = self.apps)
	
	def edit_file(self):
		if self.env.cf is None:
			return
		self.execute_file(self.env.cf, app = 'editor')

	def open_console(self, mode = ':'):
		if self.ui.can('open_console'):
			self.ui.open_console(mode)

	def move_pointer(self, relative = 0, absolute = None):
		self.env.cf = self.env.pwd.move_pointer(relative, absolute)

	def move_pointer_by_pages(self, relative):
		self.env.cf = self.env.pwd.move_pointer(
				relative = int(relative * self.env.termsize[0]))

	def scroll(self, relative):
		if self.ui.can('scroll'):
			self.ui.scroll(relative)
			self.env.cf = self.env.pwd.pointed_file

	def redraw(self):
		self.ui.redraw()

	def reset(self):
		old_path = self.env.pwd.path
		self.env.directories = {}
		self.enter_dir(old_path)

	def toggle_boolean_option(self, string):
		if isinstance(self.env.settings[string], bool):
			self.env.settings[string] ^= True