Rename utils.url to utils.urlutils.

This commit is contained in:
Florian Bruhin 2014-08-26 20:33:41 +02:00
parent 8bd64382bd
commit 5adf48ed3d
5 changed files with 9 additions and 9 deletions

View File

@ -347,8 +347,9 @@ following guidelines:
* Convert a string to a QUrl object as early as possible, i.e. directly after * Convert a string to a QUrl object as early as possible, i.e. directly after
the user did enter it. the user did enter it.
- Use `utils.url.fuzzy_url` if the URL is entered by the user somewhere. - Use `utils.urlutils.fuzzy_url` if the URL is entered by the user
- Be sure you handle `utils.url.FuzzyError` and display an error somewhere.
- Be sure you handle `utils.urlutils.FuzzyError` and display an error
message to the user. message to the user.
* Convert a `QUrl` object to a string as late as possible, e.g. before * Convert a `QUrl` object to a string as late as possible, e.g. before
displaying it to the user. displaying it to the user.

View File

@ -44,8 +44,7 @@ from qutebrowser.browser import quickmarks, cookies, downloads
from qutebrowser.widgets import mainwindow, console, crash from qutebrowser.widgets import mainwindow, console, crash
from qutebrowser.keyinput import modeparsers, keyparser, modeman from qutebrowser.keyinput import modeparsers, keyparser, modeman
from qutebrowser.utils import (log, version, message, utilcmds, readline, from qutebrowser.utils import (log, version, message, utilcmds, readline,
utils, qtutils) utils, qtutils, urlutils)
from qutebrowser.utils import url as urlutils
from qutebrowser.utils import usertypes as utypes from qutebrowser.utils import usertypes as utypes

View File

@ -34,8 +34,8 @@ from qutebrowser.commands import utils as cmdutils
from qutebrowser.commands import exceptions as cmdexc from qutebrowser.commands import exceptions as cmdexc
from qutebrowser.config import config from qutebrowser.config import config
from qutebrowser.browser import hints, quickmarks from qutebrowser.browser import hints, quickmarks
from qutebrowser.utils import message, webelem, editor, usertypes, log, qtutils from qutebrowser.utils import (message, webelem, editor, usertypes, log,
from qutebrowser.utils import url as urlutils qtutils, urlutils)
class CommandDispatcher: class CommandDispatcher:

View File

@ -19,13 +19,13 @@
# pylint: disable=protected-access # pylint: disable=protected-access
"""Tests for qutebrowser.utils.url.""" """Tests for qutebrowser.utils.urlutils."""
import unittest import unittest
from PyQt5.QtCore import QUrl from PyQt5.QtCore import QUrl
from qutebrowser.utils import url as urlutils from qutebrowser.utils import urlutils
from qutebrowser.test import stubs from qutebrowser.test import stubs
@ -112,7 +112,7 @@ class SearchUrlTests(unittest.TestCase):
urlutils.config = self.config urlutils.config = self.config
@unittest.mock.patch('qutebrowser.utils.url.config.get', autospec=True) @unittest.mock.patch('qutebrowser.utils.urlutils.config.get', autospec=True)
class IsUrlTests(unittest.TestCase): class IsUrlTests(unittest.TestCase):
"""Tests for is_url. """Tests for is_url.