autosearch bugfix and debug output
This commit is contained in:
parent
27d354633c
commit
bbab0e7430
@ -29,7 +29,7 @@ show_completion = true
|
||||
ignorecase = true
|
||||
wrapsearch = true
|
||||
startpage = http://www.duckduckgo.com/
|
||||
auto_search = fuzzy
|
||||
auto_search = naive
|
||||
|
||||
[tabbar]
|
||||
# movable: bool, whether tabs should be movable
|
||||
|
@ -93,7 +93,6 @@ def is_about_url(url):
|
||||
def is_url(url):
|
||||
"""Return True if url (QUrl) seems to be a valid URL."""
|
||||
urlstr = urlstring(url)
|
||||
logging.debug('Checking if "{}" is an URL'.format(urlstr))
|
||||
|
||||
try:
|
||||
autosearch = config.config.getboolean('general', 'auto_search')
|
||||
@ -105,6 +104,9 @@ def is_url(url):
|
||||
else:
|
||||
autosearch = None
|
||||
|
||||
logging.debug('Checking if "{}" is an URL (autosearch={}).'.format(
|
||||
urlstr, autosearch))
|
||||
|
||||
if autosearch is None:
|
||||
# no autosearch, so everything is an URL.
|
||||
return True
|
||||
@ -123,6 +125,8 @@ def is_url(url):
|
||||
elif autosearch == 'naive':
|
||||
logging.debug('Checking via naive check')
|
||||
return _is_url_naive(url)
|
||||
else:
|
||||
raise ValueError("Invalid autosearch value")
|
||||
|
||||
|
||||
def _is_url_naive(url):
|
||||
|
Loading…
Reference in New Issue
Block a user