From 57f2280e933ede2953c35b1c3c71e471c7fc1d84 Mon Sep 17 00:00:00 2001 From: hut Date: Sat, 1 Oct 2011 20:52:08 +0200 Subject: widgets.browserview: removed old code (for bookmark drawing) --- ranger/gui/widgets/browserview.py | 35 +---------------------------------- 1 file changed, 1 insertion(+), 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 @@ -121,37 +121,6 @@ class BrowserView(Widget, DisplayableContainer): except: pass - 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.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() @@ -161,8 +130,6 @@ class BrowserView(Widget, DisplayableContainer): 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) -- cgit 1.4.1-2-gfad0