Fix checks

This commit is contained in:
Florian Bruhin 2014-03-03 21:19:29 +01:00
parent 508d9e347c
commit b75fc347dc
4 changed files with 9 additions and 8 deletions

View File

@ -48,14 +48,13 @@ from PyQt5.QtCore import pyqtSlot, QTimer, QEventLoop
import qutebrowser
import qutebrowser.commands.utils as cmdutils
import qutebrowser.config.config as config
import qutebrowser.config.style as style
import qutebrowser.network.qutescheme as qutescheme
from qutebrowser.widgets.mainwindow import MainWindow
from qutebrowser.widgets.crash import CrashDialog
from qutebrowser.commands.keys import KeyParser
from qutebrowser.utils.appdirs import AppDirs
from qutebrowser.utils.misc import dotted_getattr
from qutebrowser.utils.debug import set_trace
from qutebrowser.utils.debug import set_trace # noqa pylint: disable=unused-import
class QuteBrowser(QApplication):

View File

@ -19,11 +19,8 @@
import shlex
import inspect
import logging
import functools
from PyQt5.QtCore import pyqtSlot, pyqtSignal, QObject
from PyQt5.QtWidgets import QApplication
from PyQt5.QtWebKitWidgets import QWebPage
import qutebrowser.config.config as config
@ -36,6 +33,7 @@ cmd_dict = {}
class register:
"""Decorator to register a new command handler.
This could also be a function, but as a class (with a "wrong" name) it's
@ -43,6 +41,8 @@ class register:
"""
# pylint: disable=too-few-public-methods
def __init__(self, instance=None, name=None, nargs=None, split_args=True,
hide=False):
self.name = name
@ -52,7 +52,6 @@ class register:
self.instance = instance
def __call__(self, func):
global cmd_dict
names = []
name = func.__name__.lower() if self.name is None else self.name
if isinstance(name, str):
@ -70,7 +69,6 @@ class register:
cmd_dict[name] = cmd
return func
def _get_nargs_count(self, func):
"""Get the number of command-arguments and count-support for a func.
@ -89,6 +87,8 @@ class register:
* (0, None)
"""
# pylint: disable=no-member
# pylint: disable=unpacking-non-sequence
# We could use inspect.signature maybe, but that's python >= 3.3 only.
spec = inspect.getfullargspec(func)
count = 'count' in spec.args
@ -103,7 +103,7 @@ class register:
minargs, maxargs = self.nargs
else:
defaultcount = (len(spec.defaults) if spec.defaults is not None
else 0)
else 0)
argcount = len(spec.args)
if 'self' in spec.args:
argcount -= 1

View File

@ -22,6 +22,7 @@ from functools import reduce
import qutebrowser
def read_file(filename):
"""Get the contents of a file contained with qutebrowser.

View File

@ -58,6 +58,7 @@ options = {
'too-many-instance-attributes',
'global-statement',
'no-init',
'too-many-arguments',
# visual noise
'locally-disabled',
],