All-caps constants
This commit is contained in:
parent
d58ef3ff84
commit
93065188a7
@ -27,7 +27,7 @@ from qutebrowser.commands.utils import (CommandParser, ArgumentCountError,
|
|||||||
NoSuchCommandError)
|
NoSuchCommandError)
|
||||||
|
|
||||||
# Possible chars for starting a commandline input
|
# Possible chars for starting a commandline input
|
||||||
startchars = ":/?"
|
STARTCHARS = ":/?"
|
||||||
|
|
||||||
|
|
||||||
class KeyParser(QObject):
|
class KeyParser(QObject):
|
||||||
@ -124,7 +124,7 @@ class KeyParser(QObject):
|
|||||||
|
|
||||||
self._keystring += txt
|
self._keystring += txt
|
||||||
|
|
||||||
if any(self._keystring == c for c in startchars):
|
if any(self._keystring == c for c in STARTCHARS):
|
||||||
self.set_cmd_text.emit(self._keystring)
|
self.set_cmd_text.emit(self._keystring)
|
||||||
self._keystring = ''
|
self._keystring = ''
|
||||||
return
|
return
|
||||||
|
@ -21,7 +21,7 @@ from qutebrowser.utils.version import version
|
|||||||
from qutebrowser.utils.url import is_about_url
|
from qutebrowser.utils.url import is_about_url
|
||||||
|
|
||||||
|
|
||||||
_html_template = """
|
_HTML_TEMPLATE = """
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
@ -81,7 +81,7 @@ def _get_html(title, snippet):
|
|||||||
HTML content as bytes.
|
HTML content as bytes.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
return _html_template.format(title=title, body=snippet).encode('UTF-8')
|
return _HTML_TEMPLATE.format(title=title, body=snippet).encode('UTF-8')
|
||||||
|
|
||||||
|
|
||||||
class AboutHandlers:
|
class AboutHandlers:
|
||||||
|
@ -373,7 +373,7 @@ class _CommandValidator(QValidator):
|
|||||||
A tuple (status, string, pos) as a QValidator should.
|
A tuple (status, string, pos) as a QValidator should.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
if any(string.startswith(c) for c in keys.startchars):
|
if any(string.startswith(c) for c in keys.STARTCHARS):
|
||||||
return (QValidator.Acceptable, string, pos)
|
return (QValidator.Acceptable, string, pos)
|
||||||
else:
|
else:
|
||||||
return (QValidator.Invalid, string, pos)
|
return (QValidator.Invalid, string, pos)
|
||||||
|
Loading…
Reference in New Issue
Block a user