From bbab0e74305f1c4195f87b8abbc2e99f4424d093 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 18 Feb 2014 12:02:07 +0100 Subject: [PATCH] autosearch bugfix and debug output --- qutebrowser/qutebrowser.conf | 2 +- qutebrowser/utils/url.py | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/qutebrowser/qutebrowser.conf b/qutebrowser/qutebrowser.conf index 0c3ec474e..43e30ba5c 100644 --- a/qutebrowser/qutebrowser.conf +++ b/qutebrowser/qutebrowser.conf @@ -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 diff --git a/qutebrowser/utils/url.py b/qutebrowser/utils/url.py index 156c57170..7866e4409 100644 --- a/qutebrowser/utils/url.py +++ b/qutebrowser/utils/url.py @@ -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):