summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2011-10-01 20:52:08 +0200
committerhut <hut@lavabit.com>2011-10-01 20:52:08 +0200
commit57f2280e933ede2953c35b1c3c71e471c7fc1d84 (patch)
tree9b555193d754ffff195f2a7e4469ac8a966b3c30 /ranger
parenta9eba67eb72c53fb316929a2930d0807e55addab (diff)
downloadranger-57f2280e933ede2953c35b1c3c71e471c7fc1d84.tar.gz
widgets.browserview: removed old code (for bookmark drawing)
Diffstat (limited to 'ranger')
-rw-r--r--ranger/gui/widgets/browserview.py35
1 files changed, 1 insertions, 34 deletions
diff --git a/ranger/gui/widgets/browserview.py b/ranger/gui/widgets/browserview.py
index b7ec14c2..7980e233 100644
--- a/ranger/gui/widgets/browserview.py
+++ b/ranger/gui/widgets/browserview.py
@@ -126,43 +126,10 @@ class BrowserView(Widget, DisplayableContainer):
 		self.color_reset()
 		self.need_clear = True
 
-		sorted_bookmarks = sorted(item for item in self.fm.bookmarks \
-			if self.settings.show_hidden_bookmarks or '/.' not in item[1].path)
-
-		def generator():
-			return zip(range(self.hei-1), sorted_bookmarks)
-
-		try:
-			maxlen = max(len(item[1].path) for i, item in generator())
-		except ValueError:
-			return
-		maxlen = min(maxlen + 5, self.wid)
-
-		whitespace = " " * maxlen
-		for line, items in generator():
-			key, mark = items
-			string = " " + key + ": " + mark.path
-			self.addstr(line, 0, whitespace)
-			self.addnstr(line, 0, string, self.wid)
-
-		if self.settings.draw_bookmark_borders:
-			self.win.hline(line+1, 0, curses.ACS_HLINE, maxlen)
-
-			if maxlen < self.wid:
-				self.win.vline(0, maxlen, curses.ACS_VLINE, line+1)
-				self.addch(line+1, maxlen, curses.ACS_LRCORNER)
-
-	def _draw_bookmarks(self):
-		self.fm.bookmarks.update_if_outdated()
-		self.color_reset()
-		self.need_clear = True
-
 		sorted_bookmarks = sorted((item for item in self.fm.bookmarks \
 			if self.fm.settings.show_hidden_bookmarks or \
 			'/.' not in item[1].path), key=lambda t: t[0].lower())
 
-		def generator():
-			return zip(range(self.hei-1), sorted_bookmarks)
 		hei = min(self.hei - 1, len(sorted_bookmarks))
 		ystart = self.hei - hei
 
@@ -170,7 +137,7 @@ class BrowserView(Widget, DisplayableContainer):
 		self.addnstr(ystart - 1, 0, "mark  path".ljust(self.wid), self.wid)
 
 		whitespace = " " * maxlen
-		for line, items in generator():
+		for line, items in zip(range(self.hei-1), sorted_bookmarks):
 			key, mark = items
 			string = " " + key + "   " + mark.path
 			self.addstr(ystart + line, 0, whitespace)
=34a60763e79546e0f84e30fbcc430632f3dbb39e'>34a60763 ^
f07bb12f ^


34a60763 ^
f07bb12f ^
























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