This commit is contained in:
Nathan Isom 2015-10-14 13:34:41 -05:00
parent e78b00cce2
commit 4876bdf7ce
2 changed files with 8 additions and 6 deletions

View File

@ -35,8 +35,8 @@ from qutebrowser.utils import message, log, usertypes, utils, qtutils, objreg
from qutebrowser.browser import webpage, hints, webelem
LoadStatus = usertypes.enum('LoadStatus', ['none', 'success', 'success_https', 'error', 'warn',
'loading'])
LoadStatus = usertypes.enum('LoadStatus', ['none', 'success', 'success_https',
'error', 'warn', 'loading'])
tab_id_gen = itertools.count(0)

View File

@ -28,8 +28,8 @@ from qutebrowser.utils import usertypes
# Note this has entries for success/error/warn from widgets.webview:LoadStatus
UrlType = usertypes.enum('UrlType', ['success', 'success_https', ' error', 'warn', 'hover',
'normal'])
UrlType = usertypes.enum('UrlType', ['success', 'success_https', ' error',
'warn', 'hover', 'normal'])
class UrlText(textbase.TextBase):
@ -120,8 +120,10 @@ class UrlText(textbase.TextBase):
status_str: The LoadStatus as string.
"""
status = webview.LoadStatus[status_str]
if status in (webview.LoadStatus.success, webview.LoadStatus.success_https,
webview.LoadStatus.error, webview.LoadStatus.warn):
if status in (webview.LoadStatus.success,
webview.LoadStatus.success_https,
webview.LoadStatus.error,
webview.LoadStatus.warn):
self._normal_url_type = UrlType[status_str]
else:
self._normal_url_type = UrlType.normal