summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--ranger/actions.py94
-rw-r--r--ranger/gui/widgets/filelist.py30
2 files changed, 59 insertions, 65 deletions
diff --git a/ranger/actions.py b/ranger/actions.py
index 9a9b3636..e0798344 100644
--- a/ranger/actions.py
+++ b/ranger/actions.py
@@ -291,8 +291,53 @@ class Actions(EnvironmentAware, SettingsAware):
 			self.env.pwd.filter = fltr
 		except:
 			pass
+	
+	def notify(self, text, duration=4, bad=False):
+		try:
+			method = self.ui.display
+		except AttributeError:
+			pass
+		else:
+			return method(text, duration=duration, bad=bad)
+	
+	def mark(self, all=False, toggle=False, val=None, movedown=None):
+		"""
+		A wrapper for the directory.mark_xyz functions.
+
+		Arguments:
+		all - change all files of the current directory at once?
+		toggle - toggle the marked-status?
+		val - mark or unmark?
+		"""
+
+		if self.env.pwd is None:
+			return
+
+		pwd = self.env.pwd
+
+		if movedown is None:
+			movedown = not all
+
+		if val is None and toggle is False:
+			return
+
+		if all:
+			if toggle:
+				pwd.toggle_all_marks()
+			else:
+				pwd.mark_all(val)
+		else:
+			item = self.env.cf
+			if item is not None:
+				if toggle:
+					pwd.toggle_mark(item)
+				else:
+					pwd.mark_item(item, val)
+
+		if movedown:
+			self.move_pointer(relative=1)
 
-# ------------------------------------ filesystem operations
+	# ------------------------------------ filesystem operations
 
 	def copy(self):
 		"""Copy the selected items"""
@@ -385,51 +430,6 @@ class Actions(EnvironmentAware, SettingsAware):
 		except OSError as err:
 			self.notify(str(err), bad=True)
 
-	
-	def notify(self, text, duration=4, bad=False):
-		try:
-			method = self.ui.display
-		except AttributeError:
-			pass
-		else:
-			return method(text, duration=duration, bad=bad)
-	
-	def mark(self, all=False, toggle=False, val=None, movedown=None):
-		"""
-		A wrapper for the directory.mark_xyz functions.
-
-		Arguments:
-		all - change all files of the current directory at once?
-		toggle - toggle the marked-status?
-		val - mark or unmark?
-		"""
-
-		if self.env.pwd is None:
-			return
-
-		pwd = self.env.pwd
-
-		if movedown is None:
-			movedown = not all
-
-		if val is None and toggle is False:
-			return
-
-		if all:
-			if toggle:
-				pwd.toggle_all_marks()
-			else:
-				pwd.mark_all(val)
-		else:
-			item = self.env.cf
-			if item is not None:
-				if toggle:
-					pwd.toggle_mark(item)
-				else:
-					pwd.mark_item(item, val)
-
-		if movedown:
-			self.move_pointer(relative=1)
+	# ------------------------------------ aliases
 
-	# aliases:
 	cd = enter_dir
diff --git a/ranger/gui/widgets/filelist.py b/ranger/gui/widgets/filelist.py
index 71ee4717..8d37b92a 100644
--- a/ranger/gui/widgets/filelist.py
+++ b/ranger/gui/widgets/filelist.py
@@ -71,7 +71,7 @@ class FileList(Widget, DisplayableContainer):
 		self.target = self.env.at_level(self.level)
 
 	def draw(self):
-		"""Call either draw_file() or draw_directory()"""
+		"""Call either _draw_file() or _draw_directory()"""
 		from ranger.fsobject.file import File
 		from ranger.fsobject.directory import Directory
 
@@ -79,22 +79,16 @@ class FileList(Widget, DisplayableContainer):
 		if self.target is None:
 			pass
 		elif type(self.target) == File:
-			self.draw_file()
+			self._draw_file()
 		elif type(self.target) == Directory:
-			self.draw_directory()
+			self._draw_directory()
 
 		DisplayableContainer.draw(self)
 
-	def finalize(self):
-		if self.postpone_drawing:
-			self.target.load_content_if_outdated()
-			self.draw_directory()
-			self.postpone_drawing = False
-
 	def _preview_this_file(self, target):
 		return target.document and not self.settings.preview_files
 
-	def draw_file(self):
+	def _draw_file(self):
 		"""Draw a preview of the file, if the settings allow it"""
 		self.win.move(0, 0)
 		if not self.target.accessible:
@@ -112,7 +106,7 @@ class FileList(Widget, DisplayableContainer):
 			self.pager.visible = True
 			self.pager.set_source(f)
 
-	def draw_directory(self):
+	def _draw_directory(self):
 		"""Draw the contents of a directory"""
 		from ranger.fsobject.directory import Directory
 		import stat
@@ -173,7 +167,7 @@ class FileList(Widget, DisplayableContainer):
 			self.color_reset()
 			return
 
-		self.set_scroll_begin()
+		self._set_scroll_begin()
 
 		selected_i = self.target.pointer
 		for line in range(self.hei):
@@ -239,7 +233,7 @@ class FileList(Widget, DisplayableContainer):
 
 			self.color_reset()
 
-	def get_scroll_begin(self):
+	def _get_scroll_begin(self):
 		"""Determines scroll_begin (the position of the first displayed file)"""
 		offset = self.settings.scroll_offset
 		dirsize = len(self.target)
@@ -263,7 +257,7 @@ class FileList(Widget, DisplayableContainer):
 
 		if original > dirsize - winsize:
 			self.target.scroll_begin = dirsize - winsize
-			return self.get_scroll_begin()
+			return self._get_scroll_begin()
 
 		if projected < upper_limit and projected > lower_limit:
 			return original
@@ -278,19 +272,19 @@ class FileList(Widget, DisplayableContainer):
 		
 		return original
 
-	def set_scroll_begin(self):
+	def _set_scroll_begin(self):
 		"""Updates the scroll_begin value"""
-		self.scroll_begin = self.get_scroll_begin()
+		self.scroll_begin = self._get_scroll_begin()
 		self.target.scroll_begin = self.scroll_begin
 
 	# TODO: does not work if options.scroll_offset is high,
 	# relative > 1 and you scroll from scroll_begin = 1 to 0
 	def scroll(self, relative):
 		"""scroll by n lines"""
-		self.set_scroll_begin()
+		self._set_scroll_begin()
 		old_value = self.target.scroll_begin
 		self.target.scroll_begin += relative
-		self.set_scroll_begin()
+		self._set_scroll_begin()
 
 		if self.target.scroll_begin == old_value:
 			self.target.move(relative = relative)
02-19 18:19:43 +0100 changed some odering in config*.h' href='/acidbong/suckless/dwm/commit/config.default.h?h=master&id=3794c6294535518fdcdf2ceb434875584189aa1e'>3794c62 ^
f196b71 ^

b515765 ^
04dec4c ^
19dcbc5 ^
73e2aba ^


5767699 ^
2c477cf ^
2aef8b9 ^
10bc0ce ^

a923298 ^

2c477cf ^

a73de0c ^
338c083 ^
2c477cf ^

10bc0ce ^

















2c477cf ^
10bc0ce ^

















2c477cf ^
b515765 ^
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