Fix a couple style issues

This commit is contained in:
Jay Kamat 2017-10-30 12:12:57 -04:00
parent 2a4163b2c7
commit 64b6852ae3
No known key found for this signature in database
GPG Key ID: 5D2E399600F4F7B5
3 changed files with 4 additions and 10 deletions

View File

@ -488,8 +488,7 @@ class TabBar(QTabBar):
def _pinned_statistics(self) -> (int, int):
"""Get the number of pinned tabs and the total width of pinned tabs."""
pinned_list = [idx
for idx in range(self.count())
pinned_list = [idx for idx in range(self.count())
if self._tab_pinned(idx)]
pinned_count = len(pinned_list)
pinned_width = sum(self.minimumTabSizeHint(idx, ellipsis=False).width()

View File

@ -185,8 +185,8 @@ def debug_cache_stats():
tabbed_browser = objreg.get('tabbed-browser', scope='window',
window='last-focused')
# pylint: disable=protected-access
tabbed_browser_info = tabbed_browser.tabBar(). \
_minimum_tab_size_hint_helper.cache_info()
tab_bar = tabbed_browser.tabBar()
tabbed_browser_info = tab_bar._minimum_tab_size_hint_helper.cache_info()
# pylint: enable=protected-access
log.misc.debug('is_valid_prefix: {}'.format(prefix_info))

View File

@ -64,9 +64,4 @@ class TestTabWidget:
with qtbot.waitExposed(widget):
widget.show()
def bench():
for _a in range(1000):
# pylint: disable=protected-access
widget._update_tab_titles()
# pylint: enable=protected-access
benchmark(bench)
benchmark(widget._update_tab_titles)