Small urlutils fixes

This commit is contained in:
Florian Bruhin 2014-05-05 13:08:20 +02:00
parent f7daa464ba
commit 8b8a17f535

View File

@ -27,6 +27,9 @@ from PyQt5.QtNetwork import QHostInfo
import qutebrowser.config.config as config import qutebrowser.config.config as config
# FIXME: we probably could raise some exceptions on invalid URLs
def _get_search_url(txt): def _get_search_url(txt):
"""Get a search engine URL for a text. """Get a search engine URL for a text.
@ -152,10 +155,8 @@ def fuzzy_url(url):
def is_special_url(url): def is_special_url(url):
"""Return True if url is an about:... or other special URL.""" """Return True if url is an about:... or other special URL."""
# FIXME this needs to be done is some nicer way special_schemes = ['about', 'qute', 'file']
_special_schemes = ['about', 'qute', 'file'] return qurl(url).scheme() in special_schemes
return any([urlstring(url).replace('http://', '').startswith(scheme) for
scheme in _special_schemes])
def is_url(url): def is_url(url):