Rename sequence.py to keyutils.py

This commit is contained in:
Florian Bruhin 2017-12-29 01:09:06 +01:00
parent dcf0d21121
commit b1dde41b74
6 changed files with 10 additions and 11 deletions

View File

@ -62,7 +62,7 @@ from PyQt5.QtWidgets import QTabWidget, QTabBar
from qutebrowser.commands import cmdutils from qutebrowser.commands import cmdutils
from qutebrowser.config import configexc from qutebrowser.config import configexc
from qutebrowser.utils import standarddir, utils, qtutils, urlutils from qutebrowser.utils import standarddir, utils, qtutils, urlutils
from qutebrowser.keyinput import sequence from qutebrowser.keyinput import keyutils
SYSTEM_PROXY = object() # Return value for Proxy type SYSTEM_PROXY = object() # Return value for Proxy type
@ -1655,4 +1655,4 @@ class Key(BaseType):
#if utils.is_special_key(value): #if utils.is_special_key(value):
# value = '<{}>'.format(utils.normalize_keystr(value[1:-1])) # value = '<{}>'.format(utils.normalize_keystr(value[1:-1]))
#return value #return value
return sequence.parse_keystring(value) return keyutils.parse_keystring(value)

View File

@ -28,7 +28,7 @@ from PyQt5.QtGui import QKeySequence
from qutebrowser.config import config from qutebrowser.config import config
from qutebrowser.utils import usertypes, log, utils from qutebrowser.utils import usertypes, log, utils
from qutebrowser.keyinput import sequence from qutebrowser.keyinput import keyutils
class BaseKeyParser(QObject): class BaseKeyParser(QObject):
@ -84,7 +84,7 @@ class BaseKeyParser(QObject):
super().__init__(parent) super().__init__(parent)
self._win_id = win_id self._win_id = win_id
self._modename = None self._modename = None
self._sequence = sequence.KeySequence() self._sequence = keyutils.KeySequence()
self._count = '' self._count = ''
if supports_count is None: if supports_count is None:
supports_count = supports_chains supports_count = supports_chains
@ -121,7 +121,7 @@ class BaseKeyParser(QObject):
A self.Match member. A self.Match member.
""" """
key = e.key() key = e.key()
txt = utils.keyevent_to_string(e) txt = keyutils.keyevent_to_string(e)
self._debug_log("Got key: 0x{:x} / text: '{}'".format(key, txt)) self._debug_log("Got key: 0x{:x} / text: '{}'".format(key, txt))
if txt is None: if txt is None:
@ -264,6 +264,6 @@ class BaseKeyParser(QObject):
if self._sequence: if self._sequence:
self._debug_log("discarding keystring '{}'.".format( self._debug_log("discarding keystring '{}'.".format(
self._sequence)) self._sequence))
self._sequence = sequence.KeySequence() self._sequence = keyutils.KeySequence()
self._count = '' self._count = ''
self.keystring_updated.emit('') self.keystring_updated.emit('')

View File

@ -30,7 +30,7 @@ from PyQt5.QtCore import pyqtSlot, Qt
from qutebrowser.commands import cmdexc from qutebrowser.commands import cmdexc
from qutebrowser.config import config from qutebrowser.config import config
from qutebrowser.keyinput import keyparser from qutebrowser.keyinput import keyparser, keyutils
from qutebrowser.utils import usertypes, log, message, objreg, utils from qutebrowser.utils import usertypes, log, message, objreg, utils
@ -298,7 +298,7 @@ class RegisterKeyParser(keyparser.CommandKeyParser):
key = e.text() key = e.text()
if key == '' or utils.keyevent_to_string(e) is None: if key == '' or keyutils.keyevent_to_string(e) is None:
# this is not a proper register key, let it pass and keep going # this is not a proper register key, let it pass and keep going
return False return False

View File

@ -35,7 +35,7 @@ from PyQt5.QtGui import QKeySequence
from qutebrowser.config import config from qutebrowser.config import config
from qutebrowser.utils import utils, usertypes from qutebrowser.utils import utils, usertypes
from qutebrowser.commands import cmdutils from qutebrowser.commands import cmdutils
from qutebrowser.keyinput import sequence from qutebrowser.keyinput import keyutils
class KeyHintView(QLabel): class KeyHintView(QLabel):
@ -107,7 +107,7 @@ class KeyHintView(QLabel):
bindings_dict = config.key_instance.get_bindings_for(modename) bindings_dict = config.key_instance.get_bindings_for(modename)
bindings = [(k, v) for (k, v) in sorted(bindings_dict.items()) bindings = [(k, v) for (k, v) in sorted(bindings_dict.items())
if k.matches(sequence.KeySequence(prefix)) and # FIXME if k.matches(keyutils.KeySequence(prefix)) and # FIXME
not blacklisted(k) and not blacklisted(k) and
(takes_count(v) or not countstr)] (takes_count(v) or not countstr)]

View File

@ -50,7 +50,6 @@ except ImportError: # pragma: no cover
import qutebrowser import qutebrowser
from qutebrowser.utils import qtutils, log, debug from qutebrowser.utils import qtutils, log, debug
from qutebrowser.keyinput import sequence
fake_clipboard = None fake_clipboard = None