Avoid pylint maybe-no-member warnings for ConfigParser.
This commit is contained in:
parent
6d709d9fd8
commit
581f88fcce
@ -202,7 +202,6 @@ class QuteBrowser(QApplication):
|
|||||||
|
|
||||||
if not opened_urls:
|
if not opened_urls:
|
||||||
logging.debug('Opening startpage')
|
logging.debug('Opening startpage')
|
||||||
# pylint: disable=maybe-no-member
|
|
||||||
for url in config.config.get('general', 'startpage').split(','):
|
for url in config.config.get('general', 'startpage').split(','):
|
||||||
self.mainwindow.tabs.tabopen(url)
|
self.mainwindow.tabs.tabopen(url)
|
||||||
|
|
||||||
|
@ -193,12 +193,16 @@ class Config(ConfigParser):
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
# pylint: disable=redefined-builtin
|
# pylint: disable=redefined-builtin
|
||||||
|
# The arguments returned by the ConfigParsers actually are strings
|
||||||
|
# already, but we add an explicit str() here to trick pylint into
|
||||||
|
# thinking a string is returned (rather than an object) to avoid
|
||||||
|
# maybe-no-member errors.
|
||||||
try:
|
try:
|
||||||
return super().get(*args, raw=raw, vars=vars)
|
return str(super().get(*args, raw=raw, vars=vars))
|
||||||
except (NoSectionError, NoOptionError):
|
except (NoSectionError, NoOptionError):
|
||||||
pass
|
pass
|
||||||
try:
|
try:
|
||||||
return self._default_cp.get(*args, raw=raw, vars=vars)
|
return str(self._default_cp.get(*args, raw=raw, vars=vars))
|
||||||
except (NoSectionError, NoOptionError):
|
except (NoSectionError, NoOptionError):
|
||||||
if fallback is _UNSET:
|
if fallback is _UNSET:
|
||||||
raise
|
raise
|
||||||
|
@ -45,7 +45,6 @@ def _get_search_url(txt):
|
|||||||
logging.debug('engine: default, term "{}"'.format(txt))
|
logging.debug('engine: default, term "{}"'.format(txt))
|
||||||
if template is None or not term:
|
if template is None or not term:
|
||||||
raise ValueError
|
raise ValueError
|
||||||
# pylint: disable=maybe-no-member
|
|
||||||
return QUrl.fromUserInput(template.format(urllib.parse.quote(term)))
|
return QUrl.fromUserInput(template.format(urllib.parse.quote(term)))
|
||||||
|
|
||||||
|
|
||||||
|
@ -86,7 +86,6 @@ class TabWidget(QTabWidget):
|
|||||||
'right': QTabBar.SelectRightTab,
|
'right': QTabBar.SelectRightTab,
|
||||||
'previous': QTabBar.SelectPreviousTab,
|
'previous': QTabBar.SelectPreviousTab,
|
||||||
}
|
}
|
||||||
# pylint: disable=maybe-no-member
|
|
||||||
self.setMovable(config.config.getboolean('tabbar', 'movable'))
|
self.setMovable(config.config.getboolean('tabbar', 'movable'))
|
||||||
self.setTabsClosable(config.config.getboolean('tabbar',
|
self.setTabsClosable(config.config.getboolean('tabbar',
|
||||||
'closebuttons'))
|
'closebuttons'))
|
||||||
|
Loading…
Reference in New Issue
Block a user