Fix lint
This commit is contained in:
parent
1a91972a5c
commit
f13607ced2
@ -23,8 +23,7 @@ import sys
|
||||
from code import InteractiveInterpreter
|
||||
|
||||
from PyQt5.QtCore import pyqtSignal, pyqtSlot, Qt
|
||||
from PyQt5.QtWidgets import (QLineEdit, QTextEdit, QWidget, QVBoxLayout,
|
||||
QApplication)
|
||||
from PyQt5.QtWidgets import QTextEdit, QWidget, QVBoxLayout, QApplication
|
||||
|
||||
import qutebrowser.config.config as config
|
||||
from qutebrowser.models.cmdhistory import (History, HistoryEmptyError,
|
||||
@ -64,6 +63,7 @@ class ConsoleLineEdit(CommandLineEdit):
|
||||
|
||||
@property
|
||||
def curprompt(self):
|
||||
"""Get the prompt which is visible currently."""
|
||||
return sys.ps2 if self._more else sys.ps1
|
||||
|
||||
@pyqtSlot(str)
|
||||
@ -143,6 +143,8 @@ class ConsoleLineEdit(CommandLineEdit):
|
||||
|
||||
class ConsoleTextEdit(QTextEdit):
|
||||
|
||||
"""Custom QTextEdit for console input."""
|
||||
|
||||
def __init__(self, parent=None):
|
||||
super().__init__(parent)
|
||||
self.setAcceptRichText(False)
|
||||
|
@ -77,6 +77,11 @@ class CommandLineEdit(QLineEdit):
|
||||
self.setCursorPosition(self._promptlen)
|
||||
|
||||
def set_prompt(self, text):
|
||||
"""Set the current prompt to text.
|
||||
|
||||
This updates the validator, and makes sure the user can't move the
|
||||
cursor behind the prompt.
|
||||
"""
|
||||
self._validator.prompt = text
|
||||
self._promptlen = len(text)
|
||||
|
||||
|
@ -21,7 +21,6 @@
|
||||
|
||||
from PyQt5.QtCore import pyqtSignal, pyqtSlot
|
||||
from PyQt5.QtWidgets import QSizePolicy, QApplication
|
||||
from PyQt5.QtGui import QValidator
|
||||
|
||||
import qutebrowser.keyinput.modeman as modeman
|
||||
import qutebrowser.commands.utils as cmdutils
|
||||
|
@ -29,6 +29,8 @@ from qutebrowser.widgets.statusbar.prompter import Prompter
|
||||
|
||||
class PromptLineEdit(MinimalLineEditMixin, QLineEdit):
|
||||
|
||||
"""QLineEdit with a minimal stylesheet."""
|
||||
|
||||
def __init__(self, parent=None):
|
||||
QLineEdit.__init__(self, parent)
|
||||
MinimalLineEditMixin.__init__(self)
|
||||
|
Loading…
Reference in New Issue
Block a user