diff --git a/qutebrowser/commands/utils.py b/qutebrowser/commands/utils.py index b8b7968ee..339c404ce 100644 --- a/qutebrowser/commands/utils.py +++ b/qutebrowser/commands/utils.py @@ -45,13 +45,14 @@ class register: def __init__(self, instance=None, name=None, nargs=None, split_args=True, hide=False, completion=None): - """Gets called on parse-time with the decorator arguments. + """Save decorator arguments. + + Gets called on parse-time with the decorator arguments. Arguments: See class attributes. """ - self.name = name self.split_args = split_args self.hide = hide @@ -60,7 +61,9 @@ class register: self.completion = completion def __call__(self, func): - """Gets called when a function should be decorated. + """Register the command before running the function. + + Gets called when a function should be decorated. Doesn't actually decorate anything, but creates a Command object and registers it in the cmd_dict. @@ -72,6 +75,7 @@ class register: The original function (unmodified). """ + # FIXME: only register commands once names = [] name = func.__name__.lower() if self.name is None else self.name if isinstance(name, str): diff --git a/qutebrowser/config/conftypes.py b/qutebrowser/config/conftypes.py index 2d305e441..0a48d121f 100644 --- a/qutebrowser/config/conftypes.py +++ b/qutebrowser/config/conftypes.py @@ -19,7 +19,9 @@ class ValidationError(ValueError): + """Exception raised when a value for a config type was invalid.""" + pass diff --git a/qutebrowser/config/sections.py b/qutebrowser/config/sections.py index 24826fbb8..f07af450c 100644 --- a/qutebrowser/config/sections.py +++ b/qutebrowser/config/sections.py @@ -180,6 +180,7 @@ class ValueList: valtype.validate(v) self.values[keytype.transform(k)] = valtype.transform(v) + class SearchEngines(ValueList): """Search engine config section.""" diff --git a/qutebrowser/widgets/completion.py b/qutebrowser/widgets/completion.py index 193be23a2..4137b1fa9 100644 --- a/qutebrowser/widgets/completion.py +++ b/qutebrowser/widgets/completion.py @@ -101,6 +101,7 @@ class CompletionView(QTreeView): def __init__(self, parent=None): super().__init__(parent) self._enabled = config.config.get('general', 'show_completion') + self._model = None self._completion_models = { 'command': CompletionFilterModel(CommandCompletionModel(self)), 'setting': CompletionFilterModel(SettingCompletionModel(self)), @@ -155,6 +156,7 @@ class CompletionView(QTreeView): """Get a new completion model. parts: The command chunks to get a completion for. + """ if len(parts) == 1: return 'command' diff --git a/run_checks.py b/run_checks.py index 70749a3b7..cefba8757 100644 --- a/run_checks.py +++ b/run_checks.py @@ -60,6 +60,7 @@ options = { 'no-init', 'too-many-arguments', 'too-few-public-methods', + 'too-many-ancestors', # visual noise 'locally-disabled', ],