Lint fixes

This commit is contained in:
Florian Bruhin 2014-03-24 11:48:56 +01:00
parent 678b4d54af
commit 1132f7bb6c
5 changed files with 13 additions and 3 deletions

View File

@ -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):

View File

@ -19,7 +19,9 @@
class ValidationError(ValueError):
"""Exception raised when a value for a config type was invalid."""
pass

View File

@ -180,6 +180,7 @@ class ValueList:
valtype.validate(v)
self.values[keytype.transform(k)] = valtype.transform(v)
class SearchEngines(ValueList):
"""Search engine config section."""

View File

@ -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'

View File

@ -60,6 +60,7 @@ options = {
'no-init',
'too-many-arguments',
'too-few-public-methods',
'too-many-ancestors',
# visual noise
'locally-disabled',
],