Some fixes for the pylint

This commit is contained in:
thuck 2016-11-07 21:25:05 +01:00
parent 4ed046d5e7
commit ec50d39578
2 changed files with 8 additions and 4 deletions

View File

@ -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',

View File

@ -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