From ec50d395781cd99c6e7b8ff95c220aed7a18e2ee Mon Sep 17 00:00:00 2001 From: thuck Date: Mon, 7 Nov 2016 21:25:05 +0100 Subject: [PATCH] Some fixes for the pylint --- qutebrowser/browser/commands.py | 5 +++-- qutebrowser/mainwindow/tabwidget.py | 7 +++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/qutebrowser/browser/commands.py b/qutebrowser/browser/commands.py index c3de57387..11dbb5288 100644 --- a/qutebrowser/browser/commands.py +++ b/qutebrowser/browser/commands.py @@ -247,7 +247,8 @@ class CommandDispatcher: self._tabbed_browser.close_tab(tab) tabbar.setSelectionBehaviorOnRemove(old_selection_behavior) - @cmdutils.register(instance='command-dispatcher', scope='window', name='tab-pin') + @cmdutils.register(instance='command-dispatcher', scope='window', + name='tab-pin') @cmdutils.argument('index') @cmdutils.argument('count', count=True) def tab_pin(self, index=None, count=None): @@ -267,7 +268,7 @@ class CommandDispatcher: index = 1 if index is None else int(index) else: index = self._count() if index is None else int(index) - + self.tab_move(index) @cmdutils.register(instance='command-dispatcher', name='open', diff --git a/qutebrowser/mainwindow/tabwidget.py b/qutebrowser/mainwindow/tabwidget.py index 8d99d5596..ac9c0ede3 100644 --- a/qutebrowser/mainwindow/tabwidget.py +++ b/qutebrowser/mainwindow/tabwidget.py @@ -447,7 +447,8 @@ class TabBar(QTabBar): else: #TODO: relative size and/or configured one try: - tab = objreg.get('tab', scope='tab', window=self._win_id, tab=index) + tab = objreg.get('tab', scope='tab', + window=self._win_id, tab=index) except KeyError: pass else: @@ -460,7 +461,9 @@ class TabBar(QTabBar): # width. #looks like this generates high cpu usage #need to register the number of pin tabs in advance - #nb_of_pins = len([None for item in range(self.count()) if objreg.get('tab', scope='tab', window=self._win_id, tab=item).pin is True]) + #nb_of_pins = len([None for item in range(self.count()) + # if objreg.get('tab', scope='tab', + # window=self._win_id, tab=item).pin is True]) #width = (self.width() + 40*nb_of_pins) / self.count() width = self.width() / self.count() ## If width is not divisible by count, add a pixel to some tabs so