From 0f4136626930d9369a4a0dfc4f72da834272efc7 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 3 Jun 2014 13:48:12 +0200 Subject: [PATCH] Fix lint --- TODO | 1 - qutebrowser/utils/completer.py | 8 +++----- qutebrowser/widgets/_completion.py | 8 ++++---- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/TODO b/TODO index 9b37df6e3..cd5354b66 100644 --- a/TODO +++ b/TODO @@ -20,7 +20,6 @@ Before 0.1 Style ===== -- initialize completion models at some nicer place (not in widget) - somehow clean up init() and save() calls New big features diff --git a/qutebrowser/utils/completer.py b/qutebrowser/utils/completer.py index f3fa777fa..1fd55887a 100644 --- a/qutebrowser/utils/completer.py +++ b/qutebrowser/utils/completer.py @@ -29,7 +29,6 @@ from qutebrowser.models.completion import ( SettingOptionCompletionModel, SettingValueCompletionModel) from qutebrowser.models.basecompletion import NoCompletionsError from qutebrowser.utils.usertypes import FakeDict -from qutebrowser.utils.log import completion as logger class Completer(QObject): @@ -139,14 +138,14 @@ class Completer(QObject): model = self._models.get(completion_name) return model - def selection_changed(self, selected, deselected): + def selection_changed(self, selected, _deselected): """Emit change_completed_part if a new item was selected. Called from the views selectionChanged method. Args: selected: New selection. - delected: Previous selection. + _delected: Previous selection. Emit: change_completed_part: Emitted when there's data for the new item. @@ -221,6 +220,5 @@ class Completer(QObject): return self.view.model().mark_all_items(pattern) - if self.view._enabled: + if self.view.enabled: self.view.show() - diff --git a/qutebrowser/widgets/_completion.py b/qutebrowser/widgets/_completion.py index f58232f4a..90a9f4f28 100644 --- a/qutebrowser/widgets/_completion.py +++ b/qutebrowser/widgets/_completion.py @@ -46,7 +46,7 @@ class CompletionView(QTreeView): Attributes: completer: The Completer instance to use. - _enabled: Whether showing the CompletionView is enabled. + enabled: Whether showing the CompletionView is enabled. _height: The height to use for the CompletionView. _height_perc: Either None or a percentage if height should be relative. _delegate: The item delegate used. @@ -92,7 +92,7 @@ class CompletionView(QTreeView): def __init__(self, parent=None): super().__init__(parent) self.completer = Completer(self) - self._enabled = config.get('completion', 'show') + self.enabled = config.get('completion', 'show') self._delegate = CompletionItemDelegate(self) self.setItemDelegate(self._delegate) @@ -184,9 +184,9 @@ class CompletionView(QTreeView): @pyqtSlot(str, str) def on_config_changed(self, section, option): - """Update self._enabled when the config changed.""" + """Update self.enabled when the config changed.""" if section == 'completion' and option == 'show': - self._enabled = config.get('completion', 'show') + self.enabled = config.get('completion', 'show') elif section == 'aliases': self._init_command_completion()