Fix pep257 issues.
This commit is contained in:
parent
5f454f3440
commit
82322beb03
@ -8,7 +8,7 @@ targets=qutebrowser,scripts
|
|||||||
# D209: Blank line before closing """ (removed from PEP257)
|
# D209: Blank line before closing """ (removed from PEP257)
|
||||||
# D402: First line should not be function's signature (false-positives)
|
# D402: First line should not be function's signature (false-positives)
|
||||||
disable=D102,D209,D402
|
disable=D102,D209,D402
|
||||||
exclude=test_.*
|
exclude=resources.py,test_content_disposition.py
|
||||||
|
|
||||||
[pylint]
|
[pylint]
|
||||||
args=--output-format=colorized,--reports=no,--rcfile=.pylintrc
|
args=--output-format=colorized,--reports=no,--rcfile=.pylintrc
|
||||||
|
@ -457,7 +457,9 @@ class Application(QApplication):
|
|||||||
|
|
||||||
@pyqtSlot()
|
@pyqtSlot()
|
||||||
def _handle_signal_wakeup(self):
|
def _handle_signal_wakeup(self):
|
||||||
"""This gets called via self._signal_notifier when there's a signal.
|
"""Handle a newly arrived signal.
|
||||||
|
|
||||||
|
This gets called via self._signal_notifier when there's a signal.
|
||||||
|
|
||||||
Python will get control here, so the signal will get handled.
|
Python will get control here, so the signal will get handled.
|
||||||
"""
|
"""
|
||||||
|
@ -59,7 +59,7 @@ class DiskCache(QNetworkDiskCache):
|
|||||||
return super().cacheSize()
|
return super().cacheSize()
|
||||||
|
|
||||||
def fileMetaData(self, filename):
|
def fileMetaData(self, filename):
|
||||||
"""Returns the QNetworkCacheMetaData for the cache file filename.
|
"""Return the QNetworkCacheMetaData for the cache file filename.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
filename: The file name as a string.
|
filename: The file name as a string.
|
||||||
@ -137,7 +137,7 @@ class DiskCache(QNetworkDiskCache):
|
|||||||
return super().remove(url)
|
return super().remove(url)
|
||||||
|
|
||||||
def updateMetaData(self, meta_data):
|
def updateMetaData(self, meta_data):
|
||||||
"""Updates the cache meta date for the meta_data's url to meta_data.
|
"""Update the cache meta date for the meta_data's url to meta_data.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
meta_data: A QNetworkCacheMetaData object.
|
meta_data: A QNetworkCacheMetaData object.
|
||||||
@ -148,7 +148,7 @@ class DiskCache(QNetworkDiskCache):
|
|||||||
super().updateMetaData(meta_data)
|
super().updateMetaData(meta_data)
|
||||||
|
|
||||||
def clear(self):
|
def clear(self):
|
||||||
"""Removes all items from the cache."""
|
"""Remove all items from the cache."""
|
||||||
if objreg.get('general', 'private-browsing'):
|
if objreg.get('general', 'private-browsing'):
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
|
@ -58,7 +58,7 @@ def _download_dir():
|
|||||||
|
|
||||||
|
|
||||||
def _path_suggestion(filename):
|
def _path_suggestion(filename):
|
||||||
"""Get the suggested file path
|
"""Get the suggested file path.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
filename: The filename to use if included in the suggestion.
|
filename: The filename to use if included in the suggestion.
|
||||||
@ -289,7 +289,7 @@ class DownloadItem(QObject):
|
|||||||
total=total, errmsg=errmsg))
|
total=total, errmsg=errmsg))
|
||||||
|
|
||||||
def _create_fileobj(self):
|
def _create_fileobj(self):
|
||||||
"""Creates a file object using the internal filename."""
|
"""Create a file object using the internal filename."""
|
||||||
try:
|
try:
|
||||||
fileobj = open(self._filename, 'wb')
|
fileobj = open(self._filename, 'wb')
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
@ -395,7 +395,7 @@ class DownloadItem(QObject):
|
|||||||
self.data_changed.emit()
|
self.data_changed.emit()
|
||||||
|
|
||||||
def delete(self):
|
def delete(self):
|
||||||
"""Delete the downloaded file"""
|
"""Delete the downloaded file."""
|
||||||
try:
|
try:
|
||||||
if self._filename is not None and os.path.exists(self._filename):
|
if self._filename is not None and os.path.exists(self._filename):
|
||||||
os.remove(self._filename)
|
os.remove(self._filename)
|
||||||
@ -451,7 +451,7 @@ class DownloadItem(QObject):
|
|||||||
self._create_fileobj()
|
self._create_fileobj()
|
||||||
|
|
||||||
def _create_full_filename(self, filename):
|
def _create_full_filename(self, filename):
|
||||||
"""Tries to create the full filename.
|
"""Try to create the full filename.
|
||||||
|
|
||||||
Return:
|
Return:
|
||||||
True if the full filename was created, False otherwise.
|
True if the full filename was created, False otherwise.
|
||||||
@ -785,7 +785,7 @@ class DownloadManager(QAbstractListModel):
|
|||||||
return download
|
return download
|
||||||
|
|
||||||
def raise_no_download(self, count):
|
def raise_no_download(self, count):
|
||||||
"""Raise an exception that the download doesn't exist
|
"""Raise an exception that the download doesn't exist.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
count: The index of the download
|
count: The index of the download
|
||||||
@ -987,7 +987,7 @@ class DownloadManager(QAbstractListModel):
|
|||||||
self.endRemoveRows()
|
self.endRemoveRows()
|
||||||
|
|
||||||
def update_indexes(self):
|
def update_indexes(self):
|
||||||
"""Update indexes of all DownloadItems"""
|
"""Update indexes of all DownloadItems."""
|
||||||
first_idx = None
|
first_idx = None
|
||||||
for i, d in enumerate(self.downloads, 1):
|
for i, d in enumerate(self.downloads, 1):
|
||||||
if first_idx is None and d.index != i:
|
if first_idx is None and d.index != i:
|
||||||
|
@ -31,9 +31,7 @@ from qutebrowser.utils import qtutils, utils, objreg
|
|||||||
|
|
||||||
|
|
||||||
def update_geometry(obj):
|
def update_geometry(obj):
|
||||||
"""WORKAROUND
|
"""Weird WORKAROUND for some weird PyQt bug (probably).
|
||||||
|
|
||||||
This is a horrible workaround for some weird PyQt bug (probably).
|
|
||||||
|
|
||||||
This actually should be a method of DownloadView, but for some reason the
|
This actually should be a method of DownloadView, but for some reason the
|
||||||
rowsInserted/rowsRemoved signals don't get disconnected from this method
|
rowsInserted/rowsRemoved signals don't get disconnected from this method
|
||||||
@ -44,7 +42,6 @@ def update_geometry(obj):
|
|||||||
Original bug: https://github.com/The-Compiler/qutebrowser/issues/167
|
Original bug: https://github.com/The-Compiler/qutebrowser/issues/167
|
||||||
Workaround bug: https://github.com/The-Compiler/qutebrowser/issues/171
|
Workaround bug: https://github.com/The-Compiler/qutebrowser/issues/171
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def _update_geometry():
|
def _update_geometry():
|
||||||
"""Actually update the geometry if the object still exists."""
|
"""Actually update the geometry if the object still exists."""
|
||||||
if sip.isdeleted(obj):
|
if sip.isdeleted(obj):
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with qutebrowser. If not, see <http://www.gnu.org/licenses/>.
|
# along with qutebrowser. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
"""Other utilities which don't fit anywhere else. """
|
"""Other utilities which don't fit anywhere else."""
|
||||||
|
|
||||||
|
|
||||||
import os.path
|
import os.path
|
||||||
|
@ -170,7 +170,7 @@ def qute_help(win_id, request):
|
|||||||
|
|
||||||
|
|
||||||
def qute_settings(win_id, _request):
|
def qute_settings(win_id, _request):
|
||||||
"""Handler for qute:settings. View/change qute configuration"""
|
"""Handler for qute:settings. View/change qute configuration."""
|
||||||
html = jinja.env.get_template('settings.html').render(
|
html = jinja.env.get_template('settings.html').render(
|
||||||
win_id=win_id, title='settings', config=configdata)
|
win_id=win_id, title='settings', config=configdata)
|
||||||
return html.encode('UTF-8', errors='xmlcharrefreplace')
|
return html.encode('UTF-8', errors='xmlcharrefreplace')
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with qutebrowser. If not, see <http://www.gnu.org/licenses/>.
|
# along with qutebrowser. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
"""pyPEG parsing for the RFC 6266 (Content-Disposition) header. """
|
"""pyPEG parsing for the RFC 6266 (Content-Disposition) header."""
|
||||||
|
|
||||||
import collections
|
import collections
|
||||||
import urllib.parse
|
import urllib.parse
|
||||||
@ -121,6 +121,7 @@ class Language(str):
|
|||||||
FIXME: This grammar is not 100% correct yet.
|
FIXME: This grammar is not 100% correct yet.
|
||||||
https://github.com/The-Compiler/qutebrowser/issues/105
|
https://github.com/The-Compiler/qutebrowser/issues/105
|
||||||
"""
|
"""
|
||||||
|
|
||||||
grammar = re.compile('[A-Za-z0-9-]+')
|
grammar = re.compile('[A-Za-z0-9-]+')
|
||||||
|
|
||||||
|
|
||||||
@ -234,7 +235,7 @@ class ContentDisposition:
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, disposition='inline', assocs=None):
|
def __init__(self, disposition='inline', assocs=None):
|
||||||
"""This constructor is used internally after parsing the header.
|
"""Used internally after parsing the header.
|
||||||
|
|
||||||
Instances should generally be created from a factory
|
Instances should generally be created from a factory
|
||||||
function, such as parse_headers and its variants.
|
function, such as parse_headers and its variants.
|
||||||
@ -264,7 +265,6 @@ class ContentDisposition:
|
|||||||
well, due to a certain browser using the part after the dot for
|
well, due to a certain browser using the part after the dot for
|
||||||
mime-sniffing. Saving it to a database is fine by itself though.
|
mime-sniffing. Saving it to a database is fine by itself though.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if 'filename*' in self.assocs:
|
if 'filename*' in self.assocs:
|
||||||
return self.assocs['filename*']
|
return self.assocs['filename*']
|
||||||
elif 'filename' in self.assocs:
|
elif 'filename' in self.assocs:
|
||||||
|
@ -141,7 +141,6 @@ def serialize(items):
|
|||||||
If 'data' goes out of scope, reading from 'stream' will result in a
|
If 'data' goes out of scope, reading from 'stream' will result in a
|
||||||
segfault!
|
segfault!
|
||||||
"""
|
"""
|
||||||
|
|
||||||
data = QByteArray()
|
data = QByteArray()
|
||||||
stream = QDataStream(data, QIODevice.ReadWrite)
|
stream = QDataStream(data, QIODevice.ReadWrite)
|
||||||
user_data = []
|
user_data = []
|
||||||
|
@ -86,7 +86,6 @@ class ArgumentParser(argparse.ArgumentParser):
|
|||||||
|
|
||||||
def enum_getter(enum):
|
def enum_getter(enum):
|
||||||
"""Function factory to get an enum getter."""
|
"""Function factory to get an enum getter."""
|
||||||
|
|
||||||
def _get_enum_item(key):
|
def _get_enum_item(key):
|
||||||
"""Helper function to get an enum item.
|
"""Helper function to get an enum item.
|
||||||
|
|
||||||
@ -104,7 +103,6 @@ def enum_getter(enum):
|
|||||||
|
|
||||||
def multitype_conv(tpl):
|
def multitype_conv(tpl):
|
||||||
"""Function factory to get a type converter for a choice of types."""
|
"""Function factory to get a type converter for a choice of types."""
|
||||||
|
|
||||||
def _convert(value):
|
def _convert(value):
|
||||||
"""Convert a value according to an iterable of possible arg types."""
|
"""Convert a value according to an iterable of possible arg types."""
|
||||||
for typ in set(tpl):
|
for typ in set(tpl):
|
||||||
|
@ -433,7 +433,6 @@ class Command:
|
|||||||
Return:
|
Return:
|
||||||
An (args, kwargs) tuple.
|
An (args, kwargs) tuple.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
args = []
|
args = []
|
||||||
kwargs = {}
|
kwargs = {}
|
||||||
signature = inspect.signature(self.handler)
|
signature = inspect.signature(self.handler)
|
||||||
|
@ -85,7 +85,6 @@ class change_filter: # pylint: disable=invalid-name
|
|||||||
Return:
|
Return:
|
||||||
The decorated function.
|
The decorated function.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@pyqtSlot(str, str)
|
@pyqtSlot(str, str)
|
||||||
@functools.wraps(func)
|
@functools.wraps(func)
|
||||||
def wrapper(wrapper_self, sectname=None, optname=None):
|
def wrapper(wrapper_self, sectname=None, optname=None):
|
||||||
|
@ -205,25 +205,26 @@ class IsVisibleIframeTests(unittest.TestCase):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
"""Set up this base situation
|
"""Set up the following base situation.
|
||||||
0, 0 300, 0
|
|
||||||
##############################
|
0, 0 300, 0
|
||||||
# #
|
##############################
|
||||||
0,10 # iframe 100,10 #
|
# #
|
||||||
#********** #
|
0,10 # iframe 100,10 #
|
||||||
#*e * elem1: 0, 0 in iframe (visible)
|
#********** #
|
||||||
#* * #
|
#*e * elem1: 0, 0 in iframe (visible)
|
||||||
#* e * elem2: 20,90 in iframe (visible)
|
#* * #
|
||||||
#********** #
|
#* e * elem2: 20,90 in iframe (visible)
|
||||||
0,110 #. .100,110 #
|
#********** #
|
||||||
#. . #
|
0,110 #. .100,110 #
|
||||||
#. e . elem3: 20,150 in iframe (not visible)
|
#. . #
|
||||||
#.......... #
|
#. e . elem3: 20,150 in iframe (not visible)
|
||||||
# e elem4: 30, 180 in main frame (visible)
|
#.......... #
|
||||||
# #
|
# e elem4: 30, 180 in main frame (visible)
|
||||||
# frame #
|
# #
|
||||||
##############################
|
# frame #
|
||||||
300, 0 300, 300
|
##############################
|
||||||
|
300, 0 300, 300
|
||||||
"""
|
"""
|
||||||
self.frame = stubs.FakeWebFrame(QRect(0, 0, 300, 300))
|
self.frame = stubs.FakeWebFrame(QRect(0, 0, 300, 300))
|
||||||
self.iframe = stubs.FakeWebFrame(QRect(0, 10, 100, 100),
|
self.iframe = stubs.FakeWebFrame(QRect(0, 10, 100, 100),
|
||||||
@ -327,7 +328,7 @@ class GetChildFramesTests(unittest.TestCase):
|
|||||||
frame.childFrames.assert_called_once_with()
|
frame.childFrames.assert_called_once_with()
|
||||||
|
|
||||||
def test_one_level(self):
|
def test_one_level(self):
|
||||||
r"""Test get_child_frames with this tree:
|
r"""Test get_child_frames with one level of children.
|
||||||
|
|
||||||
o parent
|
o parent
|
||||||
/ \
|
/ \
|
||||||
@ -346,7 +347,7 @@ class GetChildFramesTests(unittest.TestCase):
|
|||||||
child2.childFrames.assert_called_once_with()
|
child2.childFrames.assert_called_once_with()
|
||||||
|
|
||||||
def test_multiple_levels(self):
|
def test_multiple_levels(self):
|
||||||
r"""Test get_child_frames with this tree:
|
r"""Test get_child_frames with multiple levels of children.
|
||||||
|
|
||||||
o root
|
o root
|
||||||
/ \
|
/ \
|
||||||
|
@ -93,25 +93,25 @@ class SearchUrlTests(unittest.TestCase):
|
|||||||
self.assertEqual(url.query(), 'q=testfoo')
|
self.assertEqual(url.query(), 'q=testfoo')
|
||||||
|
|
||||||
def test_engine_pre(self):
|
def test_engine_pre(self):
|
||||||
"""Test first word is search engine name"""
|
"""Test search engine name with one word."""
|
||||||
url = urlutils._get_search_url('test testfoo')
|
url = urlutils._get_search_url('test testfoo')
|
||||||
self.assertEqual(url.host(), 'www.qutebrowser.org')
|
self.assertEqual(url.host(), 'www.qutebrowser.org')
|
||||||
self.assertEqual(url.query(), 'q=testfoo')
|
self.assertEqual(url.query(), 'q=testfoo')
|
||||||
|
|
||||||
def test_engine_pre_multiple_words(self):
|
def test_engine_pre_multiple_words(self):
|
||||||
"""Test first word is search engine name"""
|
"""Test search engine name with multiple words."""
|
||||||
url = urlutils._get_search_url('test testfoo bar foo')
|
url = urlutils._get_search_url('test testfoo bar foo')
|
||||||
self.assertEqual(url.host(), 'www.qutebrowser.org')
|
self.assertEqual(url.host(), 'www.qutebrowser.org')
|
||||||
self.assertEqual(url.query(), 'q=testfoo bar foo')
|
self.assertEqual(url.query(), 'q=testfoo bar foo')
|
||||||
|
|
||||||
def test_engine_pre_whitespace_at_end(self):
|
def test_engine_pre_whitespace_at_end(self):
|
||||||
"""Test first word is search engine name"""
|
"""Test search engine name with one word and whitespace."""
|
||||||
url = urlutils._get_search_url('test testfoo ')
|
url = urlutils._get_search_url('test testfoo ')
|
||||||
self.assertEqual(url.host(), 'www.qutebrowser.org')
|
self.assertEqual(url.host(), 'www.qutebrowser.org')
|
||||||
self.assertEqual(url.query(), 'q=testfoo')
|
self.assertEqual(url.query(), 'q=testfoo')
|
||||||
|
|
||||||
def test_engine_with_bang_pre(self):
|
def test_engine_with_bang_pre(self):
|
||||||
"""Test search engine with a prepended !hasbang."""
|
"""Test search engine with a prepended !bang."""
|
||||||
url = urlutils._get_search_url('!python testfoo')
|
url = urlutils._get_search_url('!python testfoo')
|
||||||
self.assertEqual(url.host(), 'www.example.com')
|
self.assertEqual(url.host(), 'www.example.com')
|
||||||
self.assertEqual(url.query(), 'q=%21python testfoo')
|
self.assertEqual(url.query(), 'q=%21python testfoo')
|
||||||
@ -177,13 +177,13 @@ class IsUrlTests(unittest.TestCase):
|
|||||||
@mock.patch('qutebrowser.utils.urlutils.config', new=stubs.ConfigStub(
|
@mock.patch('qutebrowser.utils.urlutils.config', new=stubs.ConfigStub(
|
||||||
get_config_stub(True)))
|
get_config_stub(True)))
|
||||||
def test_search_autosearch(self):
|
def test_search_autosearch(self):
|
||||||
"""Test explicit search with auto-search=True"""
|
"""Test explicit search with auto-search=True."""
|
||||||
self.assertFalse(urlutils.is_url('test foo'))
|
self.assertFalse(urlutils.is_url('test foo'))
|
||||||
|
|
||||||
@mock.patch('qutebrowser.utils.urlutils.config', new=stubs.ConfigStub(
|
@mock.patch('qutebrowser.utils.urlutils.config', new=stubs.ConfigStub(
|
||||||
get_config_stub(False)))
|
get_config_stub(False)))
|
||||||
def test_search_no_autosearch(self):
|
def test_search_no_autosearch(self):
|
||||||
"""Test explicit search with auto-search=False"""
|
"""Test explicit search with auto-search=False."""
|
||||||
self.assertFalse(urlutils.is_url('test foo'))
|
self.assertFalse(urlutils.is_url('test foo'))
|
||||||
|
|
||||||
|
|
||||||
|
@ -364,7 +364,9 @@ class IsEnumTests(unittest.TestCase):
|
|||||||
def test_class(self):
|
def test_class(self):
|
||||||
"""Test is_enum with a non-enum class."""
|
"""Test is_enum with a non-enum class."""
|
||||||
class Test:
|
class Test:
|
||||||
"""Test class for is_enum"""
|
|
||||||
|
"""Test class for is_enum."""
|
||||||
|
|
||||||
pass
|
pass
|
||||||
self.assertFalse(utils.is_enum(Test))
|
self.assertFalse(utils.is_enum(Test))
|
||||||
|
|
||||||
|
@ -51,7 +51,6 @@ def log_signals(obj):
|
|||||||
|
|
||||||
Can be used as class decorator.
|
Can be used as class decorator.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def log_slot(obj, signal, *args):
|
def log_slot(obj, signal, *args):
|
||||||
"""Slot connected to a signal to log it."""
|
"""Slot connected to a signal to log it."""
|
||||||
dbg = dbg_signal(signal, args)
|
dbg = dbg_signal(signal, args)
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with qutebrowser. If not, see <http://www.gnu.org/licenses/>.
|
# along with qutebrowser. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
"""Utilities related to jinja2. """
|
"""Utilities related to jinja2."""
|
||||||
|
|
||||||
import os.path
|
import os.path
|
||||||
|
|
||||||
@ -49,7 +49,7 @@ class Loader(jinja2.BaseLoader):
|
|||||||
|
|
||||||
|
|
||||||
def _guess_autoescape(template_name):
|
def _guess_autoescape(template_name):
|
||||||
"""Turns autoescape on/off based on the filetype.
|
"""Turn autoescape on/off based on the filetype.
|
||||||
|
|
||||||
Based on http://jinja.pocoo.org/docs/dev/api/#autoescaping
|
Based on http://jinja.pocoo.org/docs/dev/api/#autoescaping
|
||||||
"""
|
"""
|
||||||
|
@ -88,7 +88,10 @@ def _get_bridge(win_id):
|
|||||||
|
|
||||||
@pyqtSlot()
|
@pyqtSlot()
|
||||||
def on_focus_changed():
|
def on_focus_changed():
|
||||||
"""Gets called when a new window has been focused."""
|
"""Show queued messages when a new window has been focused.
|
||||||
|
|
||||||
|
Gets called when a new window has been focused.
|
||||||
|
"""
|
||||||
while _QUEUED:
|
while _QUEUED:
|
||||||
msg = _QUEUED.pop()
|
msg = _QUEUED.pop()
|
||||||
delta = datetime.datetime.now() - msg.time
|
delta = datetime.datetime.now() - msg.time
|
||||||
|
@ -193,7 +193,6 @@ def _has_explicit_scheme(url):
|
|||||||
Args:
|
Args:
|
||||||
url: The URL as QUrl.
|
url: The URL as QUrl.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Note that generic URI syntax actually would allow a second colon
|
# Note that generic URI syntax actually would allow a second colon
|
||||||
# after the scheme delimiter. Since we don't know of any URIs
|
# after the scheme delimiter. Since we don't know of any URIs
|
||||||
# using this and want to support e.g. searching for scoped C++
|
# using this and want to support e.g. searching for scoped C++
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with qutebrowser. If not, see <http://www.gnu.org/licenses/>.
|
# along with qutebrowser. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
"""Other utilities which don't fit anywhere else. """
|
"""Other utilities which don't fit anywhere else."""
|
||||||
|
|
||||||
import io
|
import io
|
||||||
import sys
|
import sys
|
||||||
@ -383,11 +383,11 @@ class FakeIOStream(io.TextIOBase):
|
|||||||
self.write = write_func
|
self.write = write_func
|
||||||
|
|
||||||
def flush(self):
|
def flush(self):
|
||||||
"""This is only here to satisfy pylint."""
|
"""Override flush() to satisfy pylint."""
|
||||||
return super().flush()
|
return super().flush()
|
||||||
|
|
||||||
def isatty(self):
|
def isatty(self):
|
||||||
"""This is only here to satisfy pylint."""
|
"""Override isatty() to satisfy pylint."""
|
||||||
return super().isatty()
|
return super().isatty()
|
||||||
|
|
||||||
|
|
||||||
@ -459,7 +459,7 @@ class prevent_exceptions: # pylint: disable=invalid-name
|
|||||||
self._predicate = predicate
|
self._predicate = predicate
|
||||||
|
|
||||||
def __call__(self, func):
|
def __call__(self, func):
|
||||||
"""Gets called when a function should be decorated.
|
"""Called when a function should be decorated.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
func: The function to be decorated.
|
func: The function to be decorated.
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with qutebrowser. If not, see <http://www.gnu.org/licenses/>.
|
# along with qutebrowser. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
""" Run different codecheckers over a codebase.
|
"""Run different codecheckers over a codebase.
|
||||||
|
|
||||||
Runs flake8, pylint, pep257, a CRLF/whitespace/conflict-checker and
|
Runs flake8, pylint, pep257, a CRLF/whitespace/conflict-checker and
|
||||||
pyroma/check-manifest by default.
|
pyroma/check-manifest by default.
|
||||||
|
Loading…
Reference in New Issue
Block a user