diff options
author | nfnty <git@nfnty.se> | 2016-12-18 09:38:42 +0100 |
---|---|---|
committer | nfnty <git@nfnty.se> | 2017-01-17 05:59:02 +0100 |
commit | 76791a70467d7223a966aa9f12f5583b01d704a8 (patch) | |
tree | 7a2f7543d439f9d0da695c00622c7b278424d9f6 /ranger/gui | |
parent | e26d163debc9f55a89a27f94a43771526d2ff0b7 (diff) | |
download | ranger-76791a70467d7223a966aa9f12f5583b01d704a8.tar.gz |
linting: autopep8
Diffstat (limited to 'ranger/gui')
-rw-r--r-- | ranger/gui/ansi.py | 3 | ||||
-rw-r--r-- | ranger/gui/bar.py | 2 | ||||
-rw-r--r-- | ranger/gui/color.py | 26 | ||||
-rw-r--r-- | ranger/gui/colorscheme.py | 6 | ||||
-rw-r--r-- | ranger/gui/context.py | 39 | ||||
-rw-r--r-- | ranger/gui/displayable.py | 8 | ||||
-rw-r--r-- | ranger/gui/mouse_event.py | 8 | ||||
-rw-r--r-- | ranger/gui/ui.py | 14 | ||||
-rw-r--r-- | ranger/gui/widgets/__init__.py | 26 | ||||
-rw-r--r-- | ranger/gui/widgets/browsercolumn.py | 14 | ||||
-rw-r--r-- | ranger/gui/widgets/console.py | 16 | ||||
-rw-r--r-- | ranger/gui/widgets/pager.py | 34 | ||||
-rw-r--r-- | ranger/gui/widgets/statusbar.py | 10 | ||||
-rw-r--r-- | ranger/gui/widgets/taskview.py | 2 | ||||
-rw-r--r-- | ranger/gui/widgets/titlebar.py | 2 | ||||
-rw-r--r-- | ranger/gui/widgets/view_base.py | 8 | ||||
-rw-r--r-- | ranger/gui/widgets/view_miller.py | 18 | ||||
-rw-r--r-- | ranger/gui/widgets/view_multipane.py | 1 |
18 files changed, 121 insertions, 116 deletions
diff --git a/ranger/gui/ansi.py b/ranger/gui/ansi.py index 091406e9..24e378e2 100644 --- a/ranger/gui/ansi.py +++ b/ranger/gui/ansi.py @@ -82,7 +82,8 @@ def text_with_fg_bg_attr(ansi_text): elif n == 49: bg = -1 - elif n >= 90 and n <= 97: # 8 aixterm high intensity colors (light but not bold) + # 8 aixterm high intensity colors (light but not bold) + elif n >= 90 and n <= 97: fg = n - 90 + 8 elif n == 99: fg = -1 diff --git a/ranger/gui/bar.py b/ranger/gui/bar.py index 12c44488..bac8adb5 100644 --- a/ranger/gui/bar.py +++ b/ranger/gui/bar.py @@ -87,6 +87,7 @@ class Bar(object): class BarSide(list): + def __init__(self, base_color_tag): self.base_color_tag = base_color_tag @@ -112,6 +113,7 @@ class BarSide(list): class ColoredString(object): + def __init__(self, string, *lst): self.string = WideString(string) self.lst = lst diff --git a/ranger/gui/color.py b/ranger/gui/color.py index aa3b931c..62870ace 100644 --- a/ranger/gui/color.py +++ b/ranger/gui/color.py @@ -46,21 +46,21 @@ def get_color(fg, bg): return COLOR_PAIRS[key] -black = curses.COLOR_BLACK -blue = curses.COLOR_BLUE -cyan = curses.COLOR_CYAN -green = curses.COLOR_GREEN +black = curses.COLOR_BLACK +blue = curses.COLOR_BLUE +cyan = curses.COLOR_CYAN +green = curses.COLOR_GREEN magenta = curses.COLOR_MAGENTA -red = curses.COLOR_RED -white = curses.COLOR_WHITE -yellow = curses.COLOR_YELLOW +red = curses.COLOR_RED +white = curses.COLOR_WHITE +yellow = curses.COLOR_YELLOW default = -1 -normal = curses.A_NORMAL -bold = curses.A_BOLD -blink = curses.A_BLINK -reverse = curses.A_REVERSE -underline = curses.A_UNDERLINE -invisible = curses.A_INVIS +normal = curses.A_NORMAL +bold = curses.A_BOLD +blink = curses.A_BLINK +reverse = curses.A_REVERSE +underline = curses.A_UNDERLINE +invisible = curses.A_INVIS default_colors = (default, default, normal) diff --git a/ranger/gui/colorscheme.py b/ranger/gui/colorscheme.py index c861a8e8..02333828 100644 --- a/ranger/gui/colorscheme.py +++ b/ranger/gui/colorscheme.py @@ -52,9 +52,9 @@ class ColorScheme(object): context = Context(keys) color = self.use(context) if len(color) != 3 or not all(isinstance(value, int) - for value in color): + for value in color): raise ValueError("Bad Value from colorscheme. Need " - "a tuple of (foreground_color, background_color, attribute).") + "a tuple of (foreground_color, background_color, attribute).") return color @cached_function @@ -123,7 +123,7 @@ def _colorscheme_name_to_class(signal): if usecustom: allow_access_to_confdir(ranger.arg.confdir, True) scheme_module = getattr(__import__(scheme_supermodule, - globals(), locals(), [scheme_name], 0), scheme_name) + globals(), locals(), [scheme_name], 0), scheme_name) if usecustom: allow_access_to_confdir(ranger.arg.confdir, False) if hasattr(scheme_module, 'Scheme') \ diff --git a/ranger/gui/context.py b/ranger/gui/context.py index e577d2be..13598b16 100644 --- a/ranger/gui/context.py +++ b/ranger/gui/context.py @@ -2,28 +2,29 @@ # License: GNU GPL version 3, see the file "AUTHORS" for details. CONTEXT_KEYS = ['reset', 'error', 'badinfo', - 'in_browser', 'in_statusbar', 'in_titlebar', 'in_console', - 'in_pager', 'in_taskview', - 'active_pane', 'inactive_pane', - 'directory', 'file', 'hostname', - 'executable', 'media', 'link', 'fifo', 'socket', 'device', - 'video', 'audio', 'image', 'media', 'document', 'container', - 'selected', 'empty', 'main_column', 'message', 'background', - 'good', 'bad', - 'space', 'permissions', 'owner', 'group', 'mtime', 'nlink', - 'scroll', 'all', 'bot', 'top', 'percentage', 'filter', - 'flat', 'marked', 'tagged', 'tag_marker', 'cut', 'copied', - 'help_markup', # COMPAT - 'seperator', 'key', 'special', 'border', # COMPAT - 'title', 'text', 'highlight', 'bars', 'quotes', 'tab', 'loaded', - 'keybuffer', - 'infostring', - 'vcsfile', 'vcsremote', 'vcsinfo', 'vcscommit', 'vcsdate', - 'vcsconflict', 'vcschanged', 'vcsunknown', 'vcsignored', - 'vcsstaged', 'vcssync', 'vcsnone', 'vcsbehind', 'vcsahead', 'vcsdiverged'] + 'in_browser', 'in_statusbar', 'in_titlebar', 'in_console', + 'in_pager', 'in_taskview', + 'active_pane', 'inactive_pane', + 'directory', 'file', 'hostname', + 'executable', 'media', 'link', 'fifo', 'socket', 'device', + 'video', 'audio', 'image', 'media', 'document', 'container', + 'selected', 'empty', 'main_column', 'message', 'background', + 'good', 'bad', + 'space', 'permissions', 'owner', 'group', 'mtime', 'nlink', + 'scroll', 'all', 'bot', 'top', 'percentage', 'filter', + 'flat', 'marked', 'tagged', 'tag_marker', 'cut', 'copied', + 'help_markup', # COMPAT + 'seperator', 'key', 'special', 'border', # COMPAT + 'title', 'text', 'highlight', 'bars', 'quotes', 'tab', 'loaded', + 'keybuffer', + 'infostring', + 'vcsfile', 'vcsremote', 'vcsinfo', 'vcscommit', 'vcsdate', + 'vcsconflict', 'vcschanged', 'vcsunknown', 'vcsignored', + 'vcsstaged', 'vcssync', 'vcsnone', 'vcsbehind', 'vcsahead', 'vcsdiverged'] class Context(object): + def __init__(self, keys): # set all given keys to True d = self.__dict__ diff --git a/ranger/gui/displayable.py b/ranger/gui/displayable.py index 62eb5300..4c5133d4 100644 --- a/ranger/gui/displayable.py +++ b/ranger/gui/displayable.py @@ -105,7 +105,7 @@ class Displayable(FileManagerAware, CursesShortcuts): x and y should be absolute coordinates. """ return (x >= self.x and x < self.x + self.wid) and \ - (y >= self.y and y < self.y + self.hei) + (y >= self.y and y < self.y + self.hei) def click(self, event): """Called when a mouse key is pressed and self.focused is True. @@ -153,12 +153,12 @@ class Displayable(FileManagerAware, CursesShortcuts): if x < 0 or y < 0: self.fm.notify("Warning: Subwindow origin below zero for <%s> " - "(x = %d, y = %d)" % (self, x, y), bad=True) + "(x = %d, y = %d)" % (self, x, y), bad=True) if x + wid > maxx or y + hei > maxy: self.fm.notify("Warning: Subwindow size out of bounds for <%s> " - "(x = %d, y = %d, hei = %d, wid = %d)" % (self, - x, y, hei, wid), bad=True) + "(x = %d, y = %d, hei = %d, wid = %d)" % (self, + x, y, hei, wid), bad=True) window_is_cleared = False diff --git a/ranger/gui/mouse_event.py b/ranger/gui/mouse_event.py index 1d3ec970..be25463e 100644 --- a/ranger/gui/mouse_event.py +++ b/ranger/gui/mouse_event.py @@ -6,10 +6,10 @@ import curses class MouseEvent(object): PRESSED = [0, - curses.BUTTON1_PRESSED, - curses.BUTTON2_PRESSED, - curses.BUTTON3_PRESSED, - curses.BUTTON4_PRESSED] + curses.BUTTON1_PRESSED, + curses.BUTTON2_PRESSED, + curses.BUTTON3_PRESSED, + curses.BUTTON4_PRESSED] CTRL_SCROLLWHEEL_MULTIPLIER = 5 def __init__(self, getmouse): diff --git a/ranger/gui/ui.py b/ranger/gui/ui.py index f10bc0f2..cb8e5718 100644 --- a/ranger/gui/ui.py +++ b/ranger/gui/ui.py @@ -172,13 +172,13 @@ class UI(DisplayableContainer): keybuffer.add(key) self.fm.hide_bookmarks() self.browser.draw_hints = not keybuffer.finished_parsing \ - and keybuffer.finished_parsing_quantifier + and keybuffer.finished_parsing_quantifier if keybuffer.result is not None: try: self.fm.execute_console(keybuffer.result, - wildcards=keybuffer.wildcards, - quantifier=keybuffer.quantifier) + wildcards=keybuffer.wildcards, + quantifier=keybuffer.quantifier) finally: if keybuffer.finished_parsing: keybuffer.clear() @@ -330,10 +330,10 @@ class UI(DisplayableContainer): cwd = os.sep.join(split[1:]) try: fixed_cwd = cwd.encode('utf-8', 'surrogateescape'). \ - decode('utf-8', 'replace') + decode('utf-8', 'replace') sys.stdout.write("%sranger:%s%s" % - (curses.tigetstr('tsl').decode('latin-1'), fixed_cwd, - curses.tigetstr('fsl').decode('latin-1'))) + (curses.tigetstr('tsl').decode('latin-1'), fixed_cwd, + curses.tigetstr('fsl').decode('latin-1'))) sys.stdout.flush() except Exception: pass @@ -451,7 +451,7 @@ class UI(DisplayableContainer): self.redraw_window() else: raise ValueError("Attempting to set invalid viewmode `%s`, should " - "be one of `%s`." % (value, "`, `".join(self.ALLOWED_VIEWMODES))) + "be one of `%s`." % (value, "`, `".join(self.ALLOWED_VIEWMODES))) viewmode = property(_get_viewmode, _set_viewmode) diff --git a/ranger/gui/widgets/__init__.py b/ranger/gui/widgets/__init__.py index 9a95509c..ae515ae1 100644 --- a/ranger/gui/widgets/__init__.py +++ b/ranger/gui/widgets/__init__.py @@ -7,24 +7,24 @@ class Widget(Displayable): """A class for classification of widgets.""" vcsstatus_symb = { - 'conflict': ('X', ['vcsconflict']), + 'conflict': ('X', ['vcsconflict']), 'untracked': ('+', ['vcschanged']), - 'deleted': ('-', ['vcschanged']), - 'changed': ('*', ['vcschanged']), - 'staged': ('*', ['vcsstaged']), - 'ignored': ('·', ['vcsignored']), - 'sync': ('√', ['vcssync']), - 'none': (' ', []), - 'unknown': ('?', ['vcsunknown']), + 'deleted': ('-', ['vcschanged']), + 'changed': ('*', ['vcschanged']), + 'staged': ('*', ['vcsstaged']), + 'ignored': ('·', ['vcsignored']), + 'sync': ('√', ['vcssync']), + 'none': (' ', []), + 'unknown': ('?', ['vcsunknown']), } vcsremotestatus_symb = { 'diverged': ('Y', ['vcsdiverged']), - 'ahead': ('>', ['vcsahead']), - 'behind': ('<', ['vcsbehind']), - 'sync': ('=', ['vcssync']), - 'none': ('⌂', ['vcsnone']), - 'unknown': ('?', ['vcsunknown']), + 'ahead': ('>', ['vcsahead']), + 'behind': ('<', ['vcsbehind']), + 'sync': ('=', ['vcssync']), + 'none': ('⌂', ['vcsnone']), + 'unknown': ('?', ['vcsunknown']), } ellipsis = {False: '~', True: '…'} diff --git a/ranger/gui/widgets/browsercolumn.py b/ranger/gui/widgets/browsercolumn.py index 829809c0..3fde7f03 100644 --- a/ranger/gui/widgets/browsercolumn.py +++ b/ranger/gui/widgets/browsercolumn.py @@ -20,7 +20,7 @@ from ranger.gui.color import * class BrowserColumn(Pager): main_column = False display_infostring = False - display_vcsstate = True + display_vcsstate = True scroll_begin = 0 target = None last_redraw_time = -1 @@ -45,7 +45,7 @@ class BrowserColumn(Pager): self.original_level = level self.settings.signal_bind('setopt.display_size_in_main_column', - self.request_redraw, weak=True) + self.request_redraw, weak=True) def request_redraw(self): self.need_redraw = True @@ -303,7 +303,7 @@ class BrowserColumn(Pager): text = current_linemode.filetitle(drawn, metadata) if drawn.marked and (self.main_column or - self.settings.display_tags_in_all_columns): + self.settings.display_tags_in_all_columns): text = " " + text # Computing predisplay data. predisplay contains a list of lists @@ -366,13 +366,13 @@ class BrowserColumn(Pager): predisplay_left.append([' ' * space, []]) elif space < 0: raise Exception("Error: there is not enough space to write " - "the text. I have computed spaces wrong.") + "the text. I have computed spaces wrong.") # Computing display data. Now we compute the display_data list # ready to display in curses. It is a list of lists [string, attr] this_color = base_color + list(drawn.mimetype_tuple) + \ - self._draw_directory_color(i, drawn, copied) + self._draw_directory_color(i, drawn, copied) display_data = [] drawn.display_data[key] = display_data @@ -510,11 +510,11 @@ class BrowserColumn(Pager): if projected > upper_limit: return min(dirsize - winsize, - original + (projected - upper_limit)) + original + (projected - upper_limit)) if projected < upper_limit: return max(0, - original - (lower_limit - projected)) + original - (lower_limit - projected)) return original diff --git a/ranger/gui/widgets/console.py b/ranger/gui/widgets/console.py index db04a9c8..85fb92a3 100644 --- a/ranger/gui/widgets/console.py +++ b/ranger/gui/widgets/console.py @@ -269,10 +269,10 @@ class Console(Widget): # Ensure that the pointer is moved utf-char-wise if self.fm.py3: self.pos = direction.move( - direction=direction.right(), - minimum=0, - maximum=len(self.line) + 1, - current=self.pos) + direction=direction.right(), + minimum=0, + maximum=len(self.line) + 1, + current=self.pos) else: if self.fm.py3: uc = list(self.line) @@ -281,10 +281,10 @@ class Console(Widget): uc = list(self.line.decode('utf-8', 'ignore')) upos = len(self.line[:self.pos].decode('utf-8', 'ignore')) newupos = direction.move( - direction=direction.right(), - minimum=0, - maximum=len(uc) + 1, - current=upos) + direction=direction.right(), + minimum=0, + maximum=len(uc) + 1, + current=upos) self.pos = len(''.join(uc[:newupos]).encode('utf-8', 'ignore')) def move_word(self, **keywords): diff --git a/ranger/gui/widgets/pager.py b/ranger/gui/widgets/pager.py index 0c81079b..979c6d62 100644 --- a/ranger/gui/widgets/pager.py +++ b/ranger/gui/widgets/pager.py @@ -81,7 +81,7 @@ class Pager(Widget): if not self.image: line_gen = self._generate_lines( - starty=self.scroll_begin, startx=self.startx) + starty=self.scroll_begin, startx=self.startx) for line, i in zip(line_gen, range(self.hei)): self._draw_line(i, line) @@ -94,7 +94,7 @@ class Pager(Widget): self.need_redraw_image = False try: self.fm.image_displayer.draw(self.image, self.x, self.y, - self.wid, self.hei) + self.wid, self.hei) except ImgDisplayUnsupportedException: self.fm.settings.preview_images = False except Exception as e: @@ -121,31 +121,31 @@ class Pager(Widget): direction = Direction(kw) if direction.horizontal(): self.startx = direction.move( - direction=direction.right(), - override=narg, - maximum=self.max_width, - current=self.startx, - pagesize=self.wid, - offset=-self.wid + 1) + direction=direction.right(), + override=narg, + maximum=self.max_width, + current=self.startx, + pagesize=self.wid, + offset=-self.wid + 1) if direction.vertical(): movement = dict( - direction=direction.down(), - override=narg, - current=self.scroll_begin, - pagesize=self.hei, - offset=-self.hei + 1) + direction=direction.down(), + override=narg, + current=self.scroll_begin, + pagesize=self.hei, + offset=-self.hei + 1) if self.source_is_stream: # For streams, we first pretend that the content ends much later, # in case there are still unread lines. desired_position = direction.move( - maximum=len(self.lines) + 9999, - **movement) + maximum=len(self.lines) + 9999, + **movement) # Then, read the new lines as needed to produce a more accurate # maximum for the movement: self._get_line(desired_position + self.hei) self.scroll_begin = direction.move( - maximum=len(self.lines), - **movement) + maximum=len(self.lines), + **movement) def press(self, key): self.fm.ui.keymaps.use_keymap('pager') diff --git a/ranger/gui/widgets/statusbar.py b/ranger/gui/widgets/statusbar.py index 0ac62d86..87cd7c53 100644 --- a/ranger/gui/widgets/statusbar.py +++ b/ranger/gui/widgets/statusbar.py @@ -37,7 +37,7 @@ class StatusBar(Widget): Widget.__init__(self, win) self.column = column self.settings.signal_bind('setopt.display_size_in_status_bar', - self.request_redraw, weak=True) + self.request_redraw, weak=True) def request_redraw(self): self.need_redraw = True @@ -111,7 +111,7 @@ class StatusBar(Widget): def _draw_message(self): self.win.erase() self.color('in_statusbar', 'message', - self.msg.bad and 'bad' or 'good') + self.msg.bad and 'bad' or 'good') self.addnstr(0, 0, self.msg.text, self.wid) def _draw_hint(self): @@ -262,7 +262,7 @@ class StatusBar(Widget): right.add(human_readable(target.disk_usage, separator='')) else: sumsize = sum(f.size for f in target.marked_items if not - f.is_directory or f._cumulative_size_calculated) + f.is_directory or f._cumulative_size_calculated) right.add(human_readable(sumsize, separator='')) right.add("/" + str(len(target.marked_items))) else: @@ -282,7 +282,7 @@ class StatusBar(Widget): right.add('Mrk', base, 'marked') elif len(target.files): right.add(str(target.pointer + 1) + '/' - + str(len(target.files)) + ' ', base) + + str(len(target.files)) + ' ', base) if max_pos <= 0: right.add('All', base, 'all') elif pos == 0: @@ -291,7 +291,7 @@ class StatusBar(Widget): right.add('Bot', base, 'bot') else: right.add('{0:0.0%}'.format(float(pos) / max_pos), - base, 'percentage') + base, 'percentage') else: right.add('0/0 All', base, 'all') diff --git a/ranger/gui/widgets/taskview.py b/ranger/gui/widgets/taskview.py index f05606c9..f72de94a 100644 --- a/ranger/gui/widgets/taskview.py +++ b/ranger/gui/widgets/taskview.py @@ -53,7 +53,7 @@ class TaskView(Widget, Accumulator): if obj.progressbar_supported and obj.percent >= 0 \ and obj.percent <= 100: self.addstr(y, 0, "%3.2f%% - %s" % - (obj.percent, descr), self.wid) + (obj.percent, descr), self.wid) wid = int(self.wid / 100.0 * obj.percent) self.color_at(y, 0, self.wid, tuple(clr)) self.color_at(y, 0, wid, tuple(clr), 'loaded') diff --git a/ranger/gui/widgets/titlebar.py b/ranger/gui/widgets/titlebar.py index d46fec62..283da3a8 100644 --- a/ranger/gui/widgets/titlebar.py +++ b/ranger/gui/widgets/titlebar.py @@ -42,7 +42,7 @@ class TitleBar(Widget): if self.wid > 2: self.color('in_titlebar', 'throbber') self.addnstr(self.y, self.wid - 2 - self.tab_width, - self.throbber, 1) + self.throbber, 1) def click(self, event): """Handle a MouseEvent""" diff --git a/ranger/gui/widgets/view_base.py b/ranger/gui/widgets/view_base.py index a50fb5ce..bc9a8260 100644 --- a/ranger/gui/widgets/view_base.py +++ b/ranger/gui/widgets/view_base.py @@ -53,7 +53,7 @@ class ViewBase(Widget, DisplayableContainer): try: x = self.main_column.x y = self.main_column.y + self.main_column.target.pointer\ - - self.main_column.scroll_begin + - self.main_column.scroll_begin self.fm.ui.win.move(y, x) except Exception: pass @@ -65,8 +65,8 @@ class ViewBase(Widget, DisplayableContainer): 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()) + if self.fm.settings.show_hidden_bookmarks or + '/.' not in item[1].path), key=lambda t: t[0].lower()) hei = min(self.hei - 1, len(sorted_bookmarks)) ystart = self.hei - hei @@ -115,7 +115,7 @@ class ViewBase(Widget, DisplayableContainer): hei = min(self.hei - 1, len(hints)) ystart = self.hei - hei self.addnstr(ystart - 1, 0, "key command".ljust(self.wid), - self.wid) + self.wid) try: self.win.chgat(ystart - 1, 0, curses.A_UNDERLINE) except Exception: diff --git a/ranger/gui/widgets/view_miller.py b/ranger/gui/widgets/view_miller.py index 42013fe9..b4db5b08 100644 --- a/ranger/gui/widgets/view_miller.py +++ b/ranger/gui/widgets/view_miller.py @@ -33,11 +33,11 @@ class ViewMiller(ViewBase): for option in ('preview_directories', 'preview_files'): self.settings.signal_bind('setopt.' + option, - self._request_clear_if_has_borders, weak=True) + self._request_clear_if_has_borders, weak=True) self.settings.signal_bind('setopt.column_ratios', self.request_clear) self.settings.signal_bind('setopt.column_ratios', self.rebuild, - priority=settings.SIGNAL_PRIORITY_AFTER_SYNC) + priority=settings.SIGNAL_PRIORITY_AFTER_SYNC) self.old_draw_borders = self.settings.draw_borders @@ -60,8 +60,8 @@ class ViewMiller(ViewBase): last = 0.1 if self.settings.padding_right else 0 if len(self.ratios) >= 2: self.stretch_ratios = self.ratios[:-2] + \ - ((self.ratios[-2] + self.ratios[-1] * 1.0 - last), - (self.ratios[-1] * last)) + ((self.ratios[-2] + self.ratios[-1] * 1.0 - last), + (self.ratios[-1] * last)) offset = 1 - len(ratios) if self.preview: @@ -132,7 +132,7 @@ class ViewMiller(ViewBase): try: win.hline(0, left_start, curses.ACS_HLINE, right_end - left_start) win.hline(self.hei - 1, left_start, curses.ACS_HLINE, - right_end - left_start) + right_end - left_start) win.vline(1, left_start, curses.ACS_VLINE, self.hei - 2) except _curses.error: pass @@ -214,16 +214,16 @@ class ViewMiller(ViewBase): if i == last_i - 1: self.pager.resize(pad, left, hei - pad * 2, - max(1, self.wid - left - pad)) + max(1, self.wid - left - pad)) if cut_off: self.columns[i].resize(pad, left, hei - pad * 2, - max(1, self.wid - left - pad)) + max(1, self.wid - left - pad)) continue try: self.columns[i].resize(pad, left, hei - pad * 2, - max(1, wid - 1)) + max(1, wid - 1)) except KeyError: pass @@ -257,7 +257,7 @@ class ViewMiller(ViewBase): # Show the preview column when it has a preview but has # been hidden (e.g. because of padding_right = False) if not self.columns[-1].visible and self.columns[-1].has_preview() \ - and not self.pager.visible: + and not self.pager.visible: self.columns[-1].visible = True if self.preview and self.is_collapsed != self._collapse(): diff --git a/ranger/gui/widgets/view_multipane.py b/ranger/gui/widgets/view_multipane.py index f8efd80f..abeb31fe 100644 --- a/ranger/gui/widgets/view_multipane.py +++ b/ranger/gui/widgets/view_multipane.py @@ -6,6 +6,7 @@ from ranger.gui.widgets.browsercolumn import BrowserColumn class ViewMultipane(ViewBase): + def __init__(self, win): ViewBase.__init__(self, win) |