diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 7c65deca8..0574fb633 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -116,7 +116,7 @@ Fixed `-v` argument for `:spawn` or pass flags to the spawned commands. - Various fixes for hinting corner-cases where following a link didn't work or the hint was drawn at the wrong position. -- Fixed crash when downloading from an URL with SSL errors +- Fixed crash when downloading from a URL with SSL errors - Close file handles correctly when a download failed - Fixed crash when using `;Y` (`:hint links yank-primary`) on a system without primary selection @@ -125,7 +125,7 @@ Fixed - Fixed a crash when entering `:-- ` in the commandline - Fixed `:debug-console` with PyQt 5.6 - Fixed qutebrowser not starting when `sys.stderr` is `None` -- Fixed crash when cancelling a download which belongs to a MHTML download +- Fixed crash when cancelling a download which belongs to an MHTML download - Fixed rebinding of keybindings being case-sensitive - Fix for tab indicators getting lost when moving tabs - Fixed handling of backspace in number hinting mode @@ -527,7 +527,7 @@ Fixed ~~~~~ - Scrolling should now work more reliably on some pages where arrow keys worked but `hjkl` didn't. -- Small improvements when checking if an input is an URL or not. +- Small improvements when checking if an input is a URL or not. - Fixed wrong cursor position when completing the first item in the completion. - Fixed exception when using search engines with {foo} in their name. - Fixed a bug where the same title was shown for all tabs on some systems. @@ -539,7 +539,7 @@ Fixed - Various fixes for deprecated key bindings and auto-migrations. - Workaround for qutebrowser not starting when there are NUL-bytes in the history (because of a currently unknown bug). - Fixed handling of keybindings containing Ctrl/Meta on OS X. -- Fixed crash when downloading an URL without filename (e.g. magnet links) via "Save as...". +- Fixed crash when downloading a URL without filename (e.g. magnet links) via "Save as...". - Fixed exception when starting qutebrowser with `:set` as argument. - Fixed horrible completion performance when the `shrink` option was set. - Sessions now store zoom/scroll-position correctly. @@ -690,7 +690,7 @@ Fixed - Scroll completion to top when showing it. - Handle unencodable file paths in config types correctly. - Fix for crash when executing a delayed command (because of a shadowed keybinding) and then unfocusing the window. -- Fix for crash when hinting on a page which doesn't have an URL yet. +- Fix for crash when hinting on a page which doesn't have a URL yet. - Fix exception when using `:set-cmd-text` with an empty argument. - Add a timeout to pastebin HTTP replies. - Various other fixes for small/rare bugs. diff --git a/doc/help/settings.asciidoc b/doc/help/settings.asciidoc index ac1cfb5b9..0093cc49b 100644 --- a/doc/help/settings.asciidoc +++ b/doc/help/settings.asciidoc @@ -1666,7 +1666,7 @@ Colors used in the UI. A value can be in one of the following format: * `#RGB`/`#RRGGBB`/`#RRRGGGBBB`/`#RRRRGGGGBBBB` - * A SVG color name as specified in http://www.w3.org/TR/SVG/types.html#ColorKeywords[the W3C specification]. + * An SVG color name as specified in http://www.w3.org/TR/SVG/types.html#ColorKeywords[the W3C specification]. * transparent (no color) * `rgb(r, g, b)` / `rgba(r, g, b, a)` (values 0-255 or percentages) * `hsv(h, s, v)` / `hsva(h, s, v, a)` (values 0-255, hue 0-359) diff --git a/misc/userscripts/password_fill b/misc/userscripts/password_fill index 2d755375e..3fd1c01fe 100755 --- a/misc/userscripts/password_fill +++ b/misc/userscripts/password_fill @@ -61,7 +61,7 @@ die() { } javascript_escape() { - # print the first argument in a escaped way, such that it can safely + # print the first argument in an escaped way, such that it can safely # be used within javascripts double quotes sed "s,[\\\'\"],\\\&,g" <<< "$1" } diff --git a/qutebrowser/app.py b/qutebrowser/app.py index e0c8fe8f9..a90532eaf 100644 --- a/qutebrowser/app.py +++ b/qutebrowser/app.py @@ -362,7 +362,7 @@ def on_focus_changed(_old, new): @pyqtSlot(QUrl) def open_desktopservices_url(url): - """Handler to open an URL via QDesktopServices.""" + """Handler to open a URL via QDesktopServices.""" win_id = mainwindow.get_window(via_ipc=True, force_window=False) tabbed_browser = objreg.get('tabbed-browser', scope='window', window=win_id) @@ -496,7 +496,7 @@ class Quitter: else: path = os.path.abspath(os.path.dirname(qutebrowser.__file__)) if not os.path.isdir(path): - # Probably running from an python egg. + # Probably running from a python egg. return for dirpath, _dirnames, filenames in os.walk(path): @@ -529,7 +529,7 @@ class Quitter: cwd = os.path.join(os.path.abspath(os.path.dirname( qutebrowser.__file__)), '..') if not os.path.isdir(cwd): - # Probably running from an python egg. Let's fallback to + # Probably running from a python egg. Let's fallback to # cwd=None and see if that works out. # See https://github.com/The-Compiler/qutebrowser/issues/323 cwd = None diff --git a/qutebrowser/browser/adblock.py b/qutebrowser/browser/adblock.py index 8a18689da..9fc09bd7b 100644 --- a/qutebrowser/browser/adblock.py +++ b/qutebrowser/browser/adblock.py @@ -48,7 +48,7 @@ def guess_zip_filename(zf): def get_fileobj(byte_io): - """Get an usable file object to read the hosts file from.""" + """Get a usable file object to read the hosts file from.""" byte_io.seek(0) # rewind downloaded file if zipfile.is_zipfile(byte_io): byte_io.seek(0) # rewind what zipfile.is_zipfile did diff --git a/qutebrowser/browser/commands.py b/qutebrowser/browser/commands.py index 2f78fc697..460b6ffe8 100644 --- a/qutebrowser/browser/commands.py +++ b/qutebrowser/browser/commands.py @@ -1247,7 +1247,7 @@ class CommandDispatcher: filename=dest) def _download_mhtml(self, dest=None): - """Download the current page as a MHTML file, including all assets. + """Download the current page as an MHTML file, including all assets. Args: dest: The file path to write the download to. diff --git a/qutebrowser/browser/pdfjs.py b/qutebrowser/browser/pdfjs.py index cf7694252..398f0494a 100644 --- a/qutebrowser/browser/pdfjs.py +++ b/qutebrowser/browser/pdfjs.py @@ -69,7 +69,7 @@ def _generate_pdfjs_script(url): def fix_urls(asset): - """Take a html page and replace each relative URL with an absolute. + """Take an html page and replace each relative URL with an absolute. This is specialized for pdf.js files and not a general purpose function. diff --git a/qutebrowser/browser/webkit/downloads.py b/qutebrowser/browser/webkit/downloads.py index fe3b6f1a9..9a1a49db8 100644 --- a/qutebrowser/browser/webkit/downloads.py +++ b/qutebrowser/browser/webkit/downloads.py @@ -678,7 +678,7 @@ class DownloadItem(QObject): self.raw_headers[bytes(key)] = bytes(value) def _handle_redirect(self): - """Handle a HTTP redirect. + """Handle an HTTP redirect. Return: True if the download was redirected, False otherwise. @@ -1041,7 +1041,7 @@ class DownloadManager(QAbstractListModel): @pyqtSlot(QNetworkRequest, QNetworkReply) def on_redirect(self, download, request, reply): - """Handle a HTTP redirect of a download. + """Handle an HTTP redirect of a download. Args: download: The old DownloadItem. diff --git a/qutebrowser/browser/webkit/history.py b/qutebrowser/browser/webkit/history.py index bdc9a5334..e4774e499 100644 --- a/qutebrowser/browser/webkit/history.py +++ b/qutebrowser/browser/webkit/history.py @@ -125,7 +125,7 @@ class WebHistoryInterface(QWebHistoryInterface): pass def historyContains(self, url_string): - """Called by WebKit to determine if an URL is contained in the history. + """Called by WebKit to determine if a URL is contained in the history. Args: url_string: The URL (as string) to check for. @@ -285,10 +285,10 @@ class WebHistory(QObject): self.cleared.emit() def add_url(self, url, title="", *, redirect=False, atime=None): - """Called by WebKit when an URL should be added to the history. + """Called by WebKit when a URL should be added to the history. Args: - url: An url (as QUrl) to add to the history. + url: A url (as QUrl) to add to the history. redirect: Whether the entry was redirected to another URL (hidden in completion) atime: Override the atime used to add the entry diff --git a/qutebrowser/browser/webkit/mhtml.py b/qutebrowser/browser/webkit/mhtml.py index 32b8c7950..f7c1be119 100644 --- a/qutebrowser/browser/webkit/mhtml.py +++ b/qutebrowser/browser/webkit/mhtml.py @@ -17,7 +17,7 @@ # You should have received a copy of the GNU General Public License # along with qutebrowser. If not, see . -"""Utils for writing a MHTML file.""" +"""Utils for writing an MHTML file.""" import functools import io @@ -83,7 +83,7 @@ def _get_css_imports_cssutils(data, inline=False): Args: data: The content of the stylesheet to scan as string. - inline: True if the argument is a inline HTML style attribute. + inline: True if the argument is an inline HTML style attribute. """ # We don't care about invalid CSS data, this will only litter the log # output with CSS errors @@ -112,7 +112,7 @@ def _get_css_imports(data, inline=False): Args: data: The content of the stylesheet to scan as string. - inline: True if the argument is a inline HTML style attribute. + inline: True if the argument is an inline HTML style attribute. """ if cssutils is None: return _get_css_imports_regex(data) @@ -149,7 +149,7 @@ E_QUOPRI = email.encoders.encode_quopri class MHTMLWriter: - """A class for outputting multiple files to a MHTML document. + """A class for outputting multiple files to an MHTML document. Attributes: root_content: The root content as bytes. @@ -480,7 +480,7 @@ class _NoCloseBytesIO(io.BytesIO): def _start_download(dest, web_view): - """Start downloading the current page and all assets to a MHTML file. + """Start downloading the current page and all assets to an MHTML file. This will overwrite dest if it already exists. diff --git a/qutebrowser/browser/webkit/network/qutescheme.py b/qutebrowser/browser/webkit/network/qutescheme.py index c543df291..bfa722d43 100644 --- a/qutebrowser/browser/webkit/network/qutescheme.py +++ b/qutebrowser/browser/webkit/network/qutescheme.py @@ -89,7 +89,7 @@ class QuteSchemeHandler(schemehandler.SchemeHandler): """ path = request.url().path() host = request.url().host() - # An url like "qute:foo" is split as "scheme:path", not "scheme:host". + # A url like "qute:foo" is split as "scheme:path", not "scheme:host". log.misc.debug("url: {}, path: {}, host {}".format( request.url().toDisplayString(), path, host)) try: diff --git a/qutebrowser/browser/webkit/tabhistory.py b/qutebrowser/browser/webkit/tabhistory.py index 05a35b720..36f984549 100644 --- a/qutebrowser/browser/webkit/tabhistory.py +++ b/qutebrowser/browser/webkit/tabhistory.py @@ -59,7 +59,7 @@ class TabHistoryItem: def _encode_url(url): - """Encode an QUrl suitable to pass to QWebHistory.""" + """Encode a QUrl suitable to pass to QWebHistory.""" data = bytes(QUrl.toPercentEncoding(url.toString(), b':/#?&+=@%*')) return data.decode('ascii') diff --git a/qutebrowser/commands/cmdexc.py b/qutebrowser/commands/cmdexc.py index 8356ccb09..766d20620 100644 --- a/qutebrowser/commands/cmdexc.py +++ b/qutebrowser/commands/cmdexc.py @@ -25,7 +25,7 @@ Defined here to avoid circular dependency hell. class CommandError(Exception): - """Raised when a command encounters a error while running.""" + """Raised when a command encounters an error while running.""" pass diff --git a/qutebrowser/completion/models/instances.py b/qutebrowser/completion/models/instances.py index 30f22ddc5..127275f01 100644 --- a/qutebrowser/completion/models/instances.py +++ b/qutebrowser/completion/models/instances.py @@ -20,7 +20,7 @@ """Global instances of the completion models. Module attributes: - _instances: An dict of available completions. + _instances: A dict of available completions. INITIALIZERS: A {usertypes.Completion: callable} dict of functions to initialize completions. """ diff --git a/qutebrowser/config/config.py b/qutebrowser/config/config.py index f788bb7ca..2d1730329 100644 --- a/qutebrowser/config/config.py +++ b/qutebrowser/config/config.py @@ -310,7 +310,7 @@ class ConfigManager(QObject): sections: The configuration data as an OrderedDict. _fname: The filename to be opened. _configdir: The dictionary to read the config from and save it in. - _interpolation: An configparser.Interpolation object + _interpolation: A configparser.Interpolation object _proxies: configparser.SectionProxy objects for sections. _initialized: Whether the ConfigManager is fully initialized yet. diff --git a/qutebrowser/config/configdata.py b/qutebrowser/config/configdata.py index e936982e6..e879d2836 100644 --- a/qutebrowser/config/configdata.py +++ b/qutebrowser/config/configdata.py @@ -94,7 +94,7 @@ SECTION_DESC = { "Colors used in the UI.\n" "A value can be in one of the following format:\n\n" " * `#RGB`/`#RRGGBB`/`#RRRGGGBBB`/`#RRRRGGGGBBBB`\n" - " * A SVG color name as specified in http://www.w3.org/TR/SVG/" + " * An SVG color name as specified in http://www.w3.org/TR/SVG/" "types.html#ColorKeywords[the W3C specification].\n" " * transparent (no color)\n" " * `rgb(r, g, b)` / `rgba(r, g, b, a)` (values 0-255 or " diff --git a/qutebrowser/config/configtypes.py b/qutebrowser/config/configtypes.py index 0273f9ca2..3000953da 100644 --- a/qutebrowser/config/configtypes.py +++ b/qutebrowser/config/configtypes.py @@ -481,7 +481,7 @@ class IntList(List): class Float(BaseType): - """Base class for an float setting. + """Base class for a float setting. Attributes: minval: Minimum value (inclusive). @@ -1644,7 +1644,7 @@ class UserAgent(BaseType): class TimestampTemplate(BaseType): - """A strftime-like template for timestamps. + """An strftime-like template for timestamps. See https://docs.python.org/3/library/datetime.html#strftime-strptime-behavior diff --git a/qutebrowser/mainwindow/tabbedbrowser.py b/qutebrowser/mainwindow/tabbedbrowser.py index ffe7b3029..682e80c78 100644 --- a/qutebrowser/mainwindow/tabbedbrowser.py +++ b/qutebrowser/mainwindow/tabbedbrowser.py @@ -270,7 +270,7 @@ class TabbedBrowser(tabwidget.TabWidget): entry = UndoEntry(tab.cur_url, history_data) self._undo_stack.append(entry) elif tab.cur_url.isEmpty(): - # There are some good reasons why an URL could be empty + # There are some good reasons why a URL could be empty # (target="_blank" with a download, see [1]), so we silently ignore # this. # [1] https://github.com/The-Compiler/qutebrowser/issues/163 diff --git a/qutebrowser/misc/httpclient.py b/qutebrowser/misc/httpclient.py index cb706b1c1..fc6f94f59 100644 --- a/qutebrowser/misc/httpclient.py +++ b/qutebrowser/misc/httpclient.py @@ -17,7 +17,7 @@ # You should have received a copy of the GNU General Public License # along with qutebrowser. If not, see . -"""A HTTP client based on QNetworkAccessManager.""" +"""An HTTP client based on QNetworkAccessManager.""" import functools import urllib.request @@ -30,7 +30,7 @@ from PyQt5.QtNetwork import (QNetworkAccessManager, QNetworkRequest, class HTTPClient(QObject): - """A HTTP client based on QNetworkAccessManager. + """An HTTP client based on QNetworkAccessManager. Intended for APIs, automatically decodes data. diff --git a/qutebrowser/misc/msgbox.py b/qutebrowser/misc/msgbox.py index 747e9a741..f6f29c38d 100644 --- a/qutebrowser/misc/msgbox.py +++ b/qutebrowser/misc/msgbox.py @@ -26,7 +26,7 @@ from PyQt5.QtWidgets import QMessageBox def msgbox(parent, title, text, *, icon, buttons=QMessageBox.Ok, on_finished=None, plain_text=None): - """Display an QMessageBox with the given icon. + """Display a QMessageBox with the given icon. Args: parent: The parent to set for the message box. diff --git a/qutebrowser/utils/message.py b/qutebrowser/utils/message.py index 811e5a055..689e883a8 100644 --- a/qutebrowser/utils/message.py +++ b/qutebrowser/utils/message.py @@ -311,7 +311,7 @@ class MessageBridge(QObject): self.s_error.emit(msg, immediately) def warning(self, msg, immediately=False, *, log_stack=True): - """Display an warning in the statusbar. + """Display a warning in the statusbar. Args: msg: The message to show. diff --git a/qutebrowser/utils/urlutils.py b/qutebrowser/utils/urlutils.py index a52239de6..bdd4651f5 100644 --- a/qutebrowser/utils/urlutils.py +++ b/qutebrowser/utils/urlutils.py @@ -168,7 +168,7 @@ def fuzzy_url(urlstr, cwd=None, relative=False, do_search=True, relative: Whether to resolve relative files. do_search: Whether to perform a search on non-URLs. force_search: Whether to force a search even if the content can be - interpreted as an URL or a path. + interpreted as a URL or a path. Return: A target QUrl to a search page or the original URL. @@ -200,7 +200,7 @@ def fuzzy_url(urlstr, cwd=None, relative=False, do_search=True, def _has_explicit_scheme(url): - """Check if an url has an explicit scheme given. + """Check if a url has an explicit scheme given. Args: url: The URL as QUrl. @@ -208,7 +208,7 @@ def _has_explicit_scheme(url): # Note that generic URI syntax actually would allow a second colon # after the scheme delimiter. Since we don't know of any URIs # using this and want to support e.g. searching for scoped C++ - # symbols, we treat this as not an URI anyways. + # symbols, we treat this as not a URI anyways. return (url.isValid() and url.scheme() and (url.host() or url.path()) and not url.path().startswith(' ') and @@ -268,7 +268,7 @@ def is_url(urlstr): url = True elif is_special_url(qurl): # Special URLs are always URLs, even with autosearch=False - log.url.debug("Is an special URL.") + log.url.debug("Is a special URL.") url = True elif autosearch == 'dns': log.url.debug("Checking via DNS check") @@ -321,7 +321,7 @@ def qurl_from_user_input(urlstr): def invalid_url_error(win_id, url, action): - """Display an error message for an URL. + """Display an error message for a URL. Args: win_id: The window ID to show the error message in. @@ -380,7 +380,7 @@ def get_path_if_valid(pathstr, cwd=None, relative=False, check_exists=False): def filename_from_url(url): - """Get a suitable filename from an URL. + """Get a suitable filename from a URL. Args: url: The URL to parse, as a QUrl. @@ -426,7 +426,7 @@ def host_tuple(url): def get_errstring(url, base="Invalid URL"): - """Get an error string for an URL. + """Get an error string for a URL. Args: url: The URL as a QUrl. @@ -500,7 +500,7 @@ class IncDecError(Exception): def _get_incdec_value(match, incdec, url): - """Get a incremented/decremented URL based on a URL match.""" + """Get an incremented/decremented URL based on a URL match.""" pre, zeroes, number, post = match.groups() # This should always succeed because we match \d+ val = int(number) diff --git a/tests/end2end/data/downloads/issue1535.html b/tests/end2end/data/downloads/issue1535.html index 0375fe39f..aec88420b 100644 --- a/tests/end2end/data/downloads/issue1535.html +++ b/tests/end2end/data/downloads/issue1535.html @@ -3,7 +3,7 @@ test case for issue 1535 -

Cancelling a download that belongs to a mhtml download.

+

Cancelling a download that belongs to an mhtml download.

See also GitHub