From 0ebef4069e136378622484b7482d43bc5a55ac53 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 26 Feb 2015 17:56:08 +0100 Subject: [PATCH] Remove debug console completing completely. Turns out pylint doesn't like it if stuff is unused because we commented code out ;) --- qutebrowser/misc/consolewidget.py | 42 ++++--------------------------- 1 file changed, 5 insertions(+), 37 deletions(-) diff --git a/qutebrowser/misc/consolewidget.py b/qutebrowser/misc/consolewidget.py index 992f826ea..8e81335a0 100644 --- a/qutebrowser/misc/consolewidget.py +++ b/qutebrowser/misc/consolewidget.py @@ -21,16 +21,14 @@ import sys import code -import rlcompleter -from PyQt5.QtCore import pyqtSignal, pyqtSlot, Qt, QStringListModel -from PyQt5.QtWidgets import (QTextEdit, QWidget, QVBoxLayout, QApplication, - QCompleter) +from PyQt5.QtCore import pyqtSignal, pyqtSlot, Qt +from PyQt5.QtWidgets import QTextEdit, QWidget, QVBoxLayout, QApplication from PyQt5.QtGui import QTextCursor from qutebrowser.config import config from qutebrowser.misc import cmdhistory, miscwidgets -from qutebrowser.utils import utils, log, objreg +from qutebrowser.utils import utils, objreg class ConsoleLineEdit(miscwidgets.CommandLineEdit): @@ -39,8 +37,6 @@ class ConsoleLineEdit(miscwidgets.CommandLineEdit): Attributes: _history: The command history of executed commands. - _rlcompleter: The rlcompleter.Completer instance. - _qcompleter: The QCompleter instance. Signals: execute: Emitted when a commandline should be executed. @@ -48,46 +44,18 @@ class ConsoleLineEdit(miscwidgets.CommandLineEdit): execute = pyqtSignal(str) - def __init__(self, namespace, parent): + def __init__(self, _namespace, parent): """Constructor. Args: - namespace: The local namespace of the interpreter. + _namespace: The local namespace of the interpreter. """ super().__init__(parent) self.update_font() objreg.get('config').changed.connect(self.update_font) - #self.textChanged.connect(self.on_text_changed) - - #self._rlcompleter = rlcompleter.Completer(namespace) - #qcompleter = QCompleter(self) - #self._model = QStringListModel(qcompleter) - #qcompleter.setModel(self._model) - #qcompleter.setCompletionMode( - # QCompleter.UnfilteredPopupCompletion) - #qcompleter.setModelSorting( - # QCompleter.CaseSensitivelySortedModel) - #self.setCompleter(qcompleter) - self._history = cmdhistory.History(parent=self) self.returnPressed.connect(self.on_return_pressed) - @pyqtSlot(str) - def on_text_changed(self, text): - """Update completion when text changed.""" - strings = set() - i = 0 - while True: - s = self._rlcompleter.complete(text, i) - if s is None: - break - else: - strings.add(s) - i += 1 - strings = sorted(list(strings)) - self._model.setStringList(strings) - log.misc.vdebug('completions: {!r}'.format(strings)) - @pyqtSlot(str) def on_return_pressed(self): """Execute the line of code which was entered."""