Various spelling fixes.
This commit is contained in:
parent
eb3b0b960f
commit
8ebac8d38c
@ -278,7 +278,7 @@ There are currently these object registries, also called 'scopes':
|
||||
`cookie-jar`, etc.)
|
||||
* The `tab` scope with objects which are per-tab (`hintmanager`, `webview`,
|
||||
etc.). Passing this scope to `objreg.get()` selects the object in the currently
|
||||
focused tab by default. A tab can be explicitely selected by passing
|
||||
focused tab by default. A tab can be explicitly selected by passing
|
||||
+tab=_tab-id_, window=_win-id_+ to it.
|
||||
|
||||
A new object can be registered by using
|
||||
@ -373,7 +373,7 @@ The types of the function arguments are inferred based on their default values,
|
||||
e.g. an argument `foo=True` will be converted to a flag `-f`/`--foo` in
|
||||
qutebrowser's commandline.
|
||||
|
||||
This behaviour can be overridden using Python's
|
||||
This behavior can be overridden using Python's
|
||||
http://legacy.python.org/dev/peps/pep-3107/[function annotations]. The
|
||||
annotation should always be a `dict`, like this:
|
||||
|
||||
@ -447,7 +447,7 @@ This option controls Valgrind's detection of self-modifying code. If no
|
||||
checking is done, if a program executes some code, then overwrites it with new
|
||||
code, and executes the new code, Valgrind will continue to execute the
|
||||
translations it made for the old code. This will likely lead to incorrect
|
||||
behaviour and/or crashes.
|
||||
behavior and/or crashes.
|
||||
|
||||
...
|
||||
|
||||
|
@ -43,8 +43,8 @@ Documentation
|
||||
In addition to the topics mentioned in this README, the following documents are
|
||||
available:
|
||||
|
||||
* A http://qutebrowser.org/img/cheatsheet-big.png[keybinding cheatsheet]: +
|
||||
image:http://qutebrowser.org/img/cheatsheet-small.png["qutebrowser keybinding cheatsheet",link="http://qutebrowser.org/img/cheatsheet-big.png"]
|
||||
* A http://qutebrowser.org/img/cheatsheet-big.png[key binding cheatsheet]: +
|
||||
image:http://qutebrowser.org/img/cheatsheet-small.png["qutebrowser key binding cheatsheet",link="http://qutebrowser.org/img/cheatsheet-big.png"]
|
||||
* link:doc/quickstart.asciidoc[Quick start guide]
|
||||
* link:doc/FAQ.asciidoc[Frequently asked questions]
|
||||
* link:CONTRIBUTING.asciidoc[Contributing to qutebrowser]
|
||||
@ -164,7 +164,7 @@ Contributors, sorted by the number of commits in descending order:
|
||||
The following people have contributed graphics:
|
||||
|
||||
* WOFall (icon)
|
||||
* regines (keybinding cheatsheet)
|
||||
* regines (key binding cheatsheet)
|
||||
|
||||
Thanks / Similiar projects
|
||||
--------------------------
|
||||
|
@ -9,7 +9,7 @@ What is qutebrowser based on?::
|
||||
+
|
||||
The concept of it is largely inspired by http://portix.bitbucket.org/dwb/[dwb]
|
||||
and http://www.vimperator.org/vimperator[Vimperator]. Many actions and
|
||||
keybindings are similar to dwb.
|
||||
key bindings are similar to dwb.
|
||||
|
||||
Why another browser?::
|
||||
It might be hard to believe, but I didn't find any browser which I was
|
||||
@ -76,7 +76,7 @@ Is there an adblocker?::
|
||||
for v0.1 if at all.
|
||||
|
||||
How do I play Youtube videos with mpv?::
|
||||
You can easily add a keybinding to play youtube videos inside a real video
|
||||
You can easily add a key binding to play youtube videos inside a real video
|
||||
player - optionally even with hinting for links:
|
||||
+
|
||||
----
|
||||
|
@ -503,7 +503,7 @@ Close the current/[count]th tab.
|
||||
==== optional arguments
|
||||
* +*-l*+, +*--left*+: Force selecting the tab to the left of the current tab.
|
||||
* +*-r*+, +*--right*+: Force selecting the tab to the right of the current tab.
|
||||
* +*-o*+, +*--opposite*+: Force selecting the tab in the oppsite direction of what's configured in 'tabs->select-on-remove'.
|
||||
* +*-o*+, +*--opposite*+: Force selecting the tab in the opposite direction of what's configured in 'tabs->select-on-remove'.
|
||||
|
||||
|
||||
==== count
|
||||
|
@ -74,8 +74,8 @@
|
||||
[options="header",width="75%",cols="25%,75%"]
|
||||
|==============
|
||||
|Setting|Description
|
||||
|<<input-timeout,timeout>>|Timeout for ambiguous keybindings.
|
||||
|<<input-partial-timeout,partial-timeout>>|Timeout for partially typed keybindings.
|
||||
|<<input-timeout,timeout>>|Timeout for ambiguous key bindings.
|
||||
|<<input-partial-timeout,partial-timeout>>|Timeout for partially typed key bindings.
|
||||
|<<input-insert-mode-on-plugins,insert-mode-on-plugins>>|Whether to switch to insert mode when clicking flash and other plugins.
|
||||
|<<input-auto-leave-insert-mode,auto-leave-insert-mode>>|Whether to leave insert mode if a non-editable element is clicked.
|
||||
|<<input-auto-insert-mode,auto-insert-mode>>|Whether to automatically enter insert mode if an editable element is focused after page load.
|
||||
@ -93,7 +93,7 @@
|
||||
|<<tabs-background-tabs,background-tabs>>|Whether to open new tabs (middleclick/ctrl+click) in background.
|
||||
|<<tabs-select-on-remove,select-on-remove>>|Which tab to select when the focused tab is removed.
|
||||
|<<tabs-new-tab-position,new-tab-position>>|How new tabs are positioned.
|
||||
|<<tabs-new-tab-position-explicit,new-tab-position-explicit>>|How new tabs opened explicitely are positioned.
|
||||
|<<tabs-new-tab-position-explicit,new-tab-position-explicit>>|How new tabs opened explicitly are positioned.
|
||||
|<<tabs-last-close,last-close>>|Behaviour when the last tab is closed.
|
||||
|<<tabs-hide-auto,hide-auto>>|Hide the tabbar if only one tab is open.
|
||||
|<<tabs-hide-always,hide-always>>|Always hide the tabbar.
|
||||
@ -697,13 +697,13 @@ Options related to input modes.
|
||||
|
||||
[[input-timeout]]
|
||||
=== timeout
|
||||
Timeout for ambiguous keybindings.
|
||||
Timeout for ambiguous key bindings.
|
||||
|
||||
Default: +pass:[500]+
|
||||
|
||||
[[input-partial-timeout]]
|
||||
=== partial-timeout
|
||||
Timeout for partially typed keybindings.
|
||||
Timeout for partially typed key bindings.
|
||||
|
||||
Default: +pass:[1000]+
|
||||
|
||||
@ -834,7 +834,7 @@ Default: +pass:[right]+
|
||||
|
||||
[[tabs-new-tab-position-explicit]]
|
||||
=== new-tab-position-explicit
|
||||
How new tabs opened explicitely are positioned.
|
||||
How new tabs opened explicitly are positioned.
|
||||
|
||||
Valid values:
|
||||
|
||||
@ -1208,7 +1208,7 @@ Whether to accept cookies.
|
||||
|
||||
Valid values:
|
||||
|
||||
* +default+: Default QtWebKit behaviour.
|
||||
* +default+: Default QtWebKit behavior.
|
||||
* +never+: Don't accept cookies at all.
|
||||
|
||||
Default: +pass:[default]+
|
||||
|
@ -8,9 +8,9 @@ time, use the `:help` command.
|
||||
What to do now
|
||||
--------------
|
||||
|
||||
* View the http://qutebrowser.org/img/cheatsheet-big.png[keybinding cheatsheet]
|
||||
to make yourself familiar with the keybindings: +
|
||||
image:http://qutebrowser.org/img/cheatsheet-small.png["qutebrowser keybinding cheatsheet",link="http://qutebrowser.org/img/cheatsheet-big.png"]
|
||||
* View the http://qutebrowser.org/img/cheatsheet-big.png[key binding cheatsheet]
|
||||
to make yourself familiar with the key bindings: +
|
||||
image:http://qutebrowser.org/img/cheatsheet-small.png["qutebrowser key binding cheatsheet",link="http://qutebrowser.org/img/cheatsheet-big.png"]
|
||||
* If you just cloned the repository, you'll need to run
|
||||
`scripts/asciidoc2html.py` to generate the documentation.
|
||||
* Go to the link:qute://settings[settings page] to set up qutebrowser the way you want it.
|
||||
|
@ -106,7 +106,7 @@ It was inspired by other browsers/addons like dwb and Vimperator/Pentadactyl.
|
||||
|
||||
- '~/.config/qutebrowser/qutebrowser.conf': Main config file.
|
||||
- '~/.config/qutebrowser/quickmarks': Saved quickmarks.
|
||||
- '~/.config/qutebrowser/keys.conf': Defined keybindings.
|
||||
- '~/.config/qutebrowser/keys.conf': Defined key bindings.
|
||||
- '~/.local/share/qutebrowser/': Various state information.
|
||||
- '~/.cache/qutebrowser/': Temporary data.
|
||||
|
||||
|
@ -3,14 +3,14 @@ Writing qutebrowser userscripts
|
||||
The Compiler <mail@qutebrowser.org>
|
||||
|
||||
qutebrowser is extensible by writing userscripts which can be called via the
|
||||
`:spawn --userscript` command, or via a keybinding.
|
||||
`:spawn --userscript` command, or via a key binding.
|
||||
|
||||
These userscripts are similiar to the (non-javascript) dwb userscripts. They
|
||||
can be written in any language which can read environment variables and write
|
||||
to a FIFO.
|
||||
|
||||
Note for simple things such as opening the current page with another browser or
|
||||
mpv, a simple keybinding to something like `:spawn mpv {url}` should suffice.
|
||||
mpv, a simple key binding to something like `:spawn mpv {url}` should suffice.
|
||||
|
||||
Also note userscripts need to have the executable bit set (`chmod +x`) for
|
||||
qutebrowser to run them.
|
||||
@ -21,7 +21,7 @@ Getting information
|
||||
The following environment variables will be set when an userscript is launched:
|
||||
|
||||
- `QUTE_MODE`: Either `hints` (started via hints) or `command` (started via
|
||||
command or keybinding).
|
||||
command or key binding).
|
||||
- `QUTE_USER_AGENT`: The currently set user agent.
|
||||
- `QUTE_FIFO`: The FIFO or file to write commands to.
|
||||
|
||||
|
@ -734,7 +734,7 @@ class Application(QApplication):
|
||||
|
||||
@cmdutils.register(instance='app', maxsplit=0, debug=True)
|
||||
def debug_pyeval(self, s):
|
||||
"""Evaluate a python string and display the results as a webpage.
|
||||
"""Evaluate a python string and display the results as a web page.
|
||||
|
||||
//
|
||||
|
||||
@ -847,8 +847,8 @@ class Application(QApplication):
|
||||
deferrer = True
|
||||
if deferrer:
|
||||
# If shutdown was called while we were asking a question, we're in
|
||||
# a still sub-eventloop (which gets quitted now) and not in the
|
||||
# main one.
|
||||
# a still sub-eventloop (which gets quit now) and not in the main
|
||||
# one.
|
||||
# This means we need to defer the real shutdown to when we're back
|
||||
# in the real main event loop, or we'll get a segfault.
|
||||
log.destroy.debug("Deferring real shutdown because question was "
|
||||
@ -898,7 +898,7 @@ class Application(QApplication):
|
||||
qInstallMessageHandler(None)
|
||||
# Now we can hopefully quit without segfaults
|
||||
log.destroy.debug("Deferring QApplication::exit...")
|
||||
# We use a singleshot timer to exit here to minimize the likelyhood of
|
||||
# We use a singleshot timer to exit here to minimize the likelihood of
|
||||
# segfaults.
|
||||
QTimer.singleShot(0, functools.partial(self.exit, status))
|
||||
|
||||
|
@ -17,7 +17,7 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with qutebrowser. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
"""Functions related to adblocking."""
|
||||
"""Functions related to ad blocking."""
|
||||
|
||||
import io
|
||||
import os.path
|
||||
|
@ -227,7 +227,7 @@ class CommandDispatcher:
|
||||
Args:
|
||||
left: Force selecting the tab to the left of the current tab.
|
||||
right: Force selecting the tab to the right of the current tab.
|
||||
opposite: Force selecting the tab in the oppsite direction of
|
||||
opposite: Force selecting the tab in the opposite direction of
|
||||
what's configured in 'tabs->select-on-remove'.
|
||||
|
||||
Return:
|
||||
@ -259,7 +259,7 @@ class CommandDispatcher:
|
||||
Args:
|
||||
left: Force selecting the tab to the left of the current tab.
|
||||
right: Force selecting the tab to the right of the current tab.
|
||||
opposite: Force selecting the tab in the oppsite direction of
|
||||
opposite: Force selecting the tab in the opposite direction of
|
||||
what's configured in 'tabs->select-on-remove'.
|
||||
count: The tab index to close, or None
|
||||
"""
|
||||
|
@ -185,7 +185,7 @@ class DownloadItem(QObject):
|
||||
done: Whether the download is finished.
|
||||
stats: A DownloadItemStats object.
|
||||
index: The index of the download in the view.
|
||||
successful: Whether the download has completed sucessfully.
|
||||
successful: Whether the download has completed successfully.
|
||||
error_msg: The current error message, or None
|
||||
autoclose: Whether to close the associated file if the download is
|
||||
done.
|
||||
@ -204,7 +204,7 @@ class DownloadItem(QObject):
|
||||
data_changed: The downloads metadata changed.
|
||||
finished: The download was finished.
|
||||
cancelled: The download was cancelled.
|
||||
error: An error with the download occured.
|
||||
error: An error with the download occurred.
|
||||
arg: The error message as string.
|
||||
redirected: Signal emitted when a download was redirected.
|
||||
arg 0: The new QNetworkRequest.
|
||||
|
@ -123,7 +123,7 @@ class DownloadView(QListView):
|
||||
Return:
|
||||
A list of either:
|
||||
- (QAction, callable) tuples.
|
||||
- (None, None) for a seperator
|
||||
- (None, None) for a separator
|
||||
"""
|
||||
actions = []
|
||||
if item is None:
|
||||
|
@ -62,7 +62,7 @@ class HintContext:
|
||||
frames: The QWebFrames to use.
|
||||
destroyed_frames: id()'s of QWebFrames which have been destroyed.
|
||||
(Workaround for https://github.com/The-Compiler/qutebrowser/issues/152)
|
||||
elems: A mapping from keystrings to (elem, label) namedtuples.
|
||||
elems: A mapping from key strings to (elem, label) namedtuples.
|
||||
baseurl: The URL of the current page.
|
||||
target: What to do with the opened links.
|
||||
normal/tab/tab_bg/window: Get passed to BrowserTab.
|
||||
@ -77,7 +77,7 @@ class HintContext:
|
||||
args: Custom arguments for userscript/spawn
|
||||
rapid: Whether to do rapid hinting.
|
||||
mainframe: The main QWebFrame where we started hinting in.
|
||||
group: The group of webelements to hint.
|
||||
group: The group of web elements to hint.
|
||||
"""
|
||||
|
||||
def __init__(self):
|
||||
@ -455,7 +455,7 @@ class HintManager(QObject):
|
||||
"""Yank an element to the clipboard or primary selection.
|
||||
|
||||
Args:
|
||||
url: The URL to open as a QURL.
|
||||
url: The URL to open as a QUrl.
|
||||
context: The HintContext to use.
|
||||
"""
|
||||
sel = context.target == Target.yank_primary
|
||||
@ -816,7 +816,7 @@ class HintManager(QObject):
|
||||
'<font color="{}">{}</font>{}'.format(
|
||||
match_color, matched, rest))
|
||||
if self._is_hidden(elems.label):
|
||||
# hidden element which matches again -> unhide it
|
||||
# hidden element which matches again -> show it
|
||||
self._show_elem(elems.label)
|
||||
else:
|
||||
# element doesn't match anymore -> hide it
|
||||
@ -835,7 +835,7 @@ class HintManager(QObject):
|
||||
if (filterstr is None or
|
||||
str(elems.elem).lower().startswith(filterstr)):
|
||||
if self._is_hidden(elems.label):
|
||||
# hidden element which matches again -> unhide it
|
||||
# hidden element which matches again -> show it
|
||||
self._show_elem(elems.label)
|
||||
else:
|
||||
# element doesn't match anymore -> hide it
|
||||
|
@ -176,7 +176,7 @@ class NetworkManager(QNetworkAccessManager):
|
||||
if answer is not None:
|
||||
# Since the answer could be something else than (user, password)
|
||||
# pylint seems to think we're unpacking a non-sequence. However we
|
||||
# *did* explicitely ask for a tuple, so it *will* always be one.
|
||||
# *did* explicitly ask for a tuple, so it *will* always be one.
|
||||
user, password = answer
|
||||
authenticator.setUser(user)
|
||||
authenticator.setPassword(password)
|
||||
|
@ -133,7 +133,7 @@ def serialize(items):
|
||||
|
||||
Return:
|
||||
A (stream, data, user_data) tuple.
|
||||
stream: The resetted QDataStream.
|
||||
stream: The reseted QDataStream.
|
||||
data: The QByteArray with the raw data.
|
||||
user_data: A list with each item's user data.
|
||||
|
||||
|
@ -332,7 +332,7 @@ def get_child_frames(startframe):
|
||||
|
||||
|
||||
def focus_elem(frame):
|
||||
"""Get the focused element in a webframe.
|
||||
"""Get the focused element in a web frame.
|
||||
|
||||
FIXME: Add tests.
|
||||
|
||||
|
@ -41,7 +41,7 @@ class BrowserPage(QWebPage):
|
||||
"""Our own QWebPage with advanced features.
|
||||
|
||||
Attributes:
|
||||
error_occured: Whether an error occured while loading.
|
||||
error_occurred: Whether an error occurred while loading.
|
||||
open_target: Where to open the next navigation request.
|
||||
("normal", "tab", "tab_bg")
|
||||
_hint_target: Override for open_target while hinting, or None.
|
||||
@ -69,7 +69,7 @@ class BrowserPage(QWebPage):
|
||||
QWebPage.ChooseMultipleFilesExtension: self._handle_multiple_files,
|
||||
}
|
||||
self._ignore_load_started = False
|
||||
self.error_occured = False
|
||||
self.error_occurred = False
|
||||
self.open_target = usertypes.ClickTarget.normal
|
||||
self._hint_target = None
|
||||
self._networkmanager = networkmanager.NetworkManager(
|
||||
@ -147,7 +147,7 @@ class BrowserPage(QWebPage):
|
||||
else:
|
||||
error_str = info.errorString
|
||||
if error_str == networkmanager.HOSTBLOCK_ERROR_STRING:
|
||||
# We don't set error_occured in this case.
|
||||
# We don't set error_occurred in this case.
|
||||
error_str = "Request blocked by host blocker."
|
||||
main_frame = info.frame.page().mainFrame()
|
||||
if info.frame != main_frame:
|
||||
@ -160,7 +160,7 @@ class BrowserPage(QWebPage):
|
||||
return False
|
||||
else:
|
||||
self._ignore_load_started = True
|
||||
self.error_occured = True
|
||||
self.error_occurred = True
|
||||
log.webview.error("Error while loading {}: {}".format(
|
||||
urlstr, error_str))
|
||||
log.webview.debug("Error domain: {}, error code: {}".format(
|
||||
@ -248,7 +248,7 @@ class BrowserPage(QWebPage):
|
||||
frame.setScrollPosition, cur_data['scroll-pos']))
|
||||
|
||||
def display_content(self, reply, mimetype):
|
||||
"""Display a QNetworkReply with an explicitely set mimetype."""
|
||||
"""Display a QNetworkReply with an explicitly set mimetype."""
|
||||
self.mainFrame().setContent(reply.readAll(), mimetype, reply.url())
|
||||
reply.deleteLater()
|
||||
|
||||
@ -312,11 +312,11 @@ class BrowserPage(QWebPage):
|
||||
|
||||
@pyqtSlot()
|
||||
def on_load_started(self):
|
||||
"""Reset error_occured when loading of a new page started."""
|
||||
"""Reset error_occurred when loading of a new page started."""
|
||||
if self._ignore_load_started:
|
||||
self._ignore_load_started = False
|
||||
else:
|
||||
self.error_occured = False
|
||||
self.error_occurred = False
|
||||
|
||||
@pyqtSlot('QWebFrame', 'QWebPage::Feature')
|
||||
def on_feature_permission_requested(self, frame, feature):
|
||||
@ -393,8 +393,8 @@ class BrowserPage(QWebPage):
|
||||
# With Qt 5.2.1 (Ubuntu Trusty) we get this when closing a tab:
|
||||
# RuntimeError: wrapped C/C++ object of type BrowserPage has
|
||||
# been deleted
|
||||
# Since the information here isn't that important for closing
|
||||
# webviews anyways, we ignore this error.
|
||||
# Since the information here isn't that important for closing web
|
||||
# views anyways, we ignore this error.
|
||||
return
|
||||
data = {
|
||||
'zoom': frame.zoomFactor(),
|
||||
|
@ -52,7 +52,7 @@ class WebView(QWebView):
|
||||
hintmanager: The HintManager instance for this view.
|
||||
progress: loading progress of this page.
|
||||
scroll_pos: The current scroll position as (x%, y%) tuple.
|
||||
statusbar_message: The current javscript statusbar message.
|
||||
statusbar_message: The current javascript statusbar message.
|
||||
inspector: The QWebInspector used for this webview.
|
||||
load_status: loading status of this page (index into LoadStatus)
|
||||
viewing_source: Whether the webview is currently displaying source
|
||||
@ -63,7 +63,7 @@ class WebView(QWebView):
|
||||
tab_id: The tab ID of the view.
|
||||
win_id: The window ID of the view.
|
||||
_cur_url: The current URL (accessed via cur_url property).
|
||||
_has_ssl_errors: Whether SSL errors occured during loading.
|
||||
_has_ssl_errors: Whether SSL errors occurred during loading.
|
||||
_zoom: A NeighborList with the zoom levels.
|
||||
_old_scroll_pos: The old scroll position.
|
||||
_check_insertmode: If True, in mouseReleaseEvent we should check if we
|
||||
@ -234,7 +234,7 @@ class WebView(QWebView):
|
||||
# me, but it works this way.
|
||||
hitresult = frame.hitTestContent(pos)
|
||||
if hitresult.isNull():
|
||||
# For some reason, the whole hitresult can be null sometimes (e.g.
|
||||
# For some reason, the whole hit result can be null sometimes (e.g.
|
||||
# on doodle menu links). If this is the case, we schedule a check
|
||||
# later (in mouseReleaseEvent) which uses webelem.focus_elem.
|
||||
log.mouse.debug("Hitresult is null!")
|
||||
@ -243,7 +243,7 @@ class WebView(QWebView):
|
||||
try:
|
||||
elem = webelem.WebElementWrapper(hitresult.element())
|
||||
except webelem.IsNullError:
|
||||
# For some reason, the hitresult element can be a null element
|
||||
# For some reason, the hit result element can be a null element
|
||||
# sometimes (e.g. when clicking the timetable fields on
|
||||
# http://www.sbb.ch/ ). If this is the case, we schedule a check
|
||||
# later (in mouseReleaseEvent) which uses webelem.focus_elem.
|
||||
@ -372,7 +372,7 @@ class WebView(QWebView):
|
||||
|
||||
@pyqtSlot('QMouseEvent')
|
||||
def on_mouse_event(self, evt):
|
||||
"""Post a new mouseevent from a hintmanager."""
|
||||
"""Post a new mouse event from a hintmanager."""
|
||||
log.modes.debug("Hint triggered, focusing {!r}".format(self))
|
||||
self.setFocus()
|
||||
QApplication.postEvent(self, evt)
|
||||
@ -393,7 +393,7 @@ class WebView(QWebView):
|
||||
true when the QWebPage has an ErrorPageExtension implemented.
|
||||
See https://github.com/The-Compiler/qutebrowser/issues/84
|
||||
"""
|
||||
ok = not self.page().error_occured
|
||||
ok = not self.page().error_occurred
|
||||
if ok and not self._has_ssl_errors:
|
||||
self._set_load_status(LoadStatus.success)
|
||||
elif ok:
|
||||
|
@ -32,7 +32,7 @@ class CommandError(Exception):
|
||||
|
||||
class CommandMetaError(Exception):
|
||||
|
||||
"""Common base class for exceptions occuring before a command is run."""
|
||||
"""Common base class for exceptions occurring before a command is run."""
|
||||
|
||||
|
||||
class NoSuchCommandError(CommandMetaError):
|
||||
|
@ -101,7 +101,7 @@ class register: # pylint: disable=invalid-name
|
||||
_instance: The object from the object registry to be used as "self".
|
||||
_scope: The scope to get _instance for.
|
||||
_name: The name (as string) or names (as list) of the command.
|
||||
_maxsplit: The maxium amounts of splits to do for the commandline, or
|
||||
_maxsplit: The maximum amounts of splits to do for the commandline, or
|
||||
None.
|
||||
_hide: Whether to hide the command or not.
|
||||
_completion: Which completion to use for arguments, as a list of
|
||||
@ -151,7 +151,7 @@ class register: # pylint: disable=invalid-name
|
||||
def _get_names(self, func):
|
||||
"""Get the name(s) which should be used for the current command.
|
||||
|
||||
If the name hasn't been overridden explicitely, the function name is
|
||||
If the name hasn't been overridden explicitly, the function name is
|
||||
transformed.
|
||||
|
||||
If it has been set, it can either be a string which is
|
||||
|
@ -160,7 +160,7 @@ class Command:
|
||||
return type_conv
|
||||
|
||||
def _get_nameconv(self, param, annotation_info):
|
||||
"""Get a dict with a name conversion for the paraeter.
|
||||
"""Get a dict with a name conversion for the parameter.
|
||||
|
||||
Args:
|
||||
param: The inspect.Parameter to handle.
|
||||
|
@ -55,7 +55,7 @@ def replace_variables(win_id, arglist):
|
||||
|
||||
class SearchRunner(QObject):
|
||||
|
||||
"""Run searches on webpages.
|
||||
"""Run searches on web pages.
|
||||
|
||||
Attributes:
|
||||
_text: The text from the last search.
|
||||
|
@ -52,7 +52,7 @@ class _QtFIFOReader(QObject):
|
||||
|
||||
@pyqtSlot()
|
||||
def read_line(self):
|
||||
"""(Try to) read a line from the fifo."""
|
||||
"""(Try to) read a line from the FIFO."""
|
||||
log.procs.debug("QSocketNotifier triggered!")
|
||||
self._notifier.setEnabled(False)
|
||||
for line in self.fifo:
|
||||
@ -60,7 +60,7 @@ class _QtFIFOReader(QObject):
|
||||
self._notifier.setEnabled(True)
|
||||
|
||||
def cleanup(self):
|
||||
"""Clean up so the fifo can be closed."""
|
||||
"""Clean up so the FIFO can be closed."""
|
||||
self._notifier.setEnabled(False)
|
||||
|
||||
|
||||
|
@ -245,7 +245,7 @@ class Completer(QObject):
|
||||
if self._cmd.prefix() != ':':
|
||||
# This is a search or gibberish, so we don't need to complete
|
||||
# anything (yet)
|
||||
# FIXME complete searchs
|
||||
# FIXME complete searches
|
||||
# https://github.com/The-Compiler/qutebrowser/issues/32
|
||||
completion.hide()
|
||||
return
|
||||
|
@ -20,8 +20,8 @@
|
||||
"""Configuration storage and config-related utilities.
|
||||
|
||||
This borrows a lot of ideas from configparser, but also has some things that
|
||||
are fundamentally different. This is why nothing inherts from configparser, but
|
||||
we borrow some methods and classes from there where it makes sense.
|
||||
are fundamentally different. This is why nothing inherits from configparser,
|
||||
but we borrow some methods and classes from there where it makes sense.
|
||||
"""
|
||||
|
||||
import os
|
||||
@ -144,7 +144,7 @@ def _init_main_config():
|
||||
for sect in config_obj.sections.values():
|
||||
for opt in sect.values.values():
|
||||
if opt.values['conf'] is None:
|
||||
# Option added to builtin defaults but not in user's
|
||||
# Option added to built-in defaults but not in user's
|
||||
# config yet
|
||||
save_manager.save('config', explicit=True, force=True)
|
||||
return
|
||||
@ -262,8 +262,8 @@ class ConfigManager(QObject):
|
||||
('completion', 'history-length'): 'cmd-history-max-items',
|
||||
}
|
||||
DELETED_OPTIONS = [
|
||||
('colors', 'tab.seperator'),
|
||||
('colors', 'tabs.seperator'),
|
||||
('colors', 'tab.separator'),
|
||||
('colors', 'tabs.separator'),
|
||||
('colors', 'completion.item.bg'),
|
||||
]
|
||||
|
||||
@ -476,7 +476,7 @@ class ConfigManager(QObject):
|
||||
def items(self, sectname, raw=True):
|
||||
"""Get a list of (optname, value) tuples for a section.
|
||||
|
||||
Implemented for configparser interpolation compatbility.
|
||||
Implemented for configparser interpolation compatibility
|
||||
|
||||
Args:
|
||||
sectname: The name of the section to get.
|
||||
@ -539,7 +539,7 @@ class ConfigManager(QObject):
|
||||
The value of the option.
|
||||
"""
|
||||
if not self._initialized:
|
||||
raise Exception("get got called before initialisation was "
|
||||
raise Exception("get got called before initialization was "
|
||||
"complete!")
|
||||
try:
|
||||
sect = self.sections[sectname]
|
||||
|
@ -56,7 +56,7 @@ FIRST_COMMENT = r"""
|
||||
# described below.
|
||||
#
|
||||
# This is the default config, so if you want to remove anything from
|
||||
# here (as opposed to change/add), for example a keybinding, set it to
|
||||
# here (as opposed to change/add), for example a key binding, set it to
|
||||
# an empty value.
|
||||
#
|
||||
# You will need to escape the following values:
|
||||
@ -270,7 +270,7 @@ DATA = collections.OrderedDict([
|
||||
"are defined:\n\n"
|
||||
"* `{perc}`: The percentage as a string like `[10%]`.\n"
|
||||
"* `{perc_raw}`: The raw percentage, e.g. `10`\n"
|
||||
"* `{title}`: The title of the current webpage\n"
|
||||
"* `{title}`: The title of the current web page\n"
|
||||
"* `{title_sep}`: The string ` - ` if a title is set, empty "
|
||||
"otherwise.\n"
|
||||
"* `{id}`: The internal window ID of this window."),
|
||||
@ -350,11 +350,11 @@ DATA = collections.OrderedDict([
|
||||
('input', sect.KeyValue(
|
||||
('timeout',
|
||||
SettingValue(typ.Int(minval=0, maxval=MAXVALS['int']), '500'),
|
||||
"Timeout for ambiguous keybindings."),
|
||||
"Timeout for ambiguous key bindings."),
|
||||
|
||||
('partial-timeout',
|
||||
SettingValue(typ.Int(minval=0, maxval=MAXVALS['int']), '1000'),
|
||||
"Timeout for partially typed keybindings."),
|
||||
"Timeout for partially typed key bindings."),
|
||||
|
||||
('insert-mode-on-plugins',
|
||||
SettingValue(typ.Bool(), 'false'),
|
||||
@ -414,7 +414,7 @@ DATA = collections.OrderedDict([
|
||||
|
||||
('new-tab-position-explicit',
|
||||
SettingValue(typ.NewTabPosition(), 'last'),
|
||||
"How new tabs opened explicitely are positioned."),
|
||||
"How new tabs opened explicitly are positioned."),
|
||||
|
||||
('last-close',
|
||||
SettingValue(typ.LastClose(), 'ignore'),
|
||||
@ -422,11 +422,11 @@ DATA = collections.OrderedDict([
|
||||
|
||||
('hide-auto',
|
||||
SettingValue(typ.Bool(), 'false'),
|
||||
"Hide the tabbar if only one tab is open."),
|
||||
"Hide the tab bar if only one tab is open."),
|
||||
|
||||
('hide-always',
|
||||
SettingValue(typ.Bool(), 'false'),
|
||||
"Always hide the tabbar."),
|
||||
"Always hide the tab bar."),
|
||||
|
||||
('wrap',
|
||||
SettingValue(typ.Bool(), 'true'),
|
||||
@ -473,7 +473,7 @@ DATA = collections.OrderedDict([
|
||||
"are defined:\n\n"
|
||||
"* `{perc}`: The percentage as a string like `[10%]`.\n"
|
||||
"* `{perc_raw}`: The raw percentage, e.g. `10`\n"
|
||||
"* `{title}`: The title of the current webpage\n"
|
||||
"* `{title}`: The title of the current web page\n"
|
||||
"* `{title_sep}`: The string ` - ` if a title is set, empty "
|
||||
"otherwise.\n"
|
||||
"* `{index}`: The index of this tab.\n"
|
||||
@ -810,7 +810,7 @@ DATA = collections.OrderedDict([
|
||||
|
||||
('tabs.bg.bar',
|
||||
SettingValue(typ.QtColor(), '#555555'),
|
||||
"Background color of the tabbar."),
|
||||
"Background color of the tab bar."),
|
||||
|
||||
('tabs.indicator.start',
|
||||
SettingValue(typ.QtColor(), '#0000aa'),
|
||||
@ -881,7 +881,7 @@ DATA = collections.OrderedDict([
|
||||
|
||||
('tabbar',
|
||||
SettingValue(typ.QtFont(), DEFAULT_FONT_SIZE + ' ${_monospace}'),
|
||||
"Font used in the tabbar."),
|
||||
"Font used in the tab bar."),
|
||||
|
||||
('statusbar',
|
||||
SettingValue(typ.Font(), DEFAULT_FONT_SIZE + ' ${_monospace}'),
|
||||
@ -949,7 +949,7 @@ DATA = collections.OrderedDict([
|
||||
KEY_FIRST_COMMENT = """
|
||||
# vim: ft=conf
|
||||
#
|
||||
# In this config file, qutebrowser's keybindings are configured.
|
||||
# In this config file, qutebrowser's key bindings are configured.
|
||||
# The format looks like this:
|
||||
#
|
||||
# [keymode]
|
||||
@ -962,8 +962,8 @@ KEY_FIRST_COMMENT = """
|
||||
# All blank lines and lines starting with '#' are ignored.
|
||||
# Inline-comments are not permitted.
|
||||
#
|
||||
# keymode is a comma separated list of modes in which the keybinding should be
|
||||
# active. If keymode starts with !, the keybinding is active in all modes
|
||||
# keymode is a comma separated list of modes in which the key binding should be
|
||||
# active. If keymode starts with !, the key binding is active in all modes
|
||||
# except the listed modes.
|
||||
#
|
||||
# For special keys (can't be part of a keychain), enclose them in `<`...`>`.
|
||||
@ -975,7 +975,7 @@ KEY_FIRST_COMMENT = """
|
||||
# * Shift: `Shift`
|
||||
#
|
||||
# For simple keys (no `<>`-signs), a capital letter means the key is pressed
|
||||
# with Shift. For special keys (with `<>`-signs), you need to explicitely add
|
||||
# with Shift. For special keys (with `<>`-signs), you need to explicitly add
|
||||
# `Shift-` to match a key pressed with shift. You can bind multiple commands
|
||||
# by separating them with `;;`.
|
||||
"""
|
||||
|
@ -32,9 +32,9 @@ class ValidationError(Error):
|
||||
"""Raised when a value for a config type was invalid.
|
||||
|
||||
Attributes:
|
||||
section: Section in which the error occured (added when catching and
|
||||
section: Section in which the error occurred (added when catching and
|
||||
re-raising the exception).
|
||||
option: Option in which the error occured.
|
||||
option: Option in which the error occurred.
|
||||
"""
|
||||
|
||||
def __init__(self, value, msg):
|
||||
|
@ -1328,7 +1328,7 @@ class AcceptCookies(BaseType):
|
||||
|
||||
"""Whether to accept a cookie."""
|
||||
|
||||
valid_values = ValidValues(('default', "Default QtWebKit behaviour."),
|
||||
valid_values = ValidValues(('default', "Default QtWebKit behavior."),
|
||||
('never', "Don't accept cookies at all."))
|
||||
|
||||
|
||||
|
@ -60,7 +60,7 @@ class ReadConfigParser(configparser.ConfigParser):
|
||||
|
||||
class ReadWriteConfigParser(ReadConfigParser):
|
||||
|
||||
"""ConfigParser subclass used for auxillary config files."""
|
||||
"""ConfigParser subclass used for auxiliary config files."""
|
||||
|
||||
def save(self):
|
||||
"""Save the config file."""
|
||||
|
@ -34,7 +34,7 @@ class KeyConfigError(Exception):
|
||||
"""Raised on errors with the key config.
|
||||
|
||||
Attributes:
|
||||
lineno: The config line in which the exception occured.
|
||||
lineno: The config line in which the exception occurred.
|
||||
"""
|
||||
|
||||
def __init__(self, msg=None):
|
||||
@ -73,7 +73,7 @@ class KeyConfigParser(QObject):
|
||||
super().__init__(parent)
|
||||
self._cur_section = None
|
||||
self._cur_command = None
|
||||
# Mapping of section name(s) to keybinding -> command dicts.
|
||||
# Mapping of section name(s) to key binding -> command dicts.
|
||||
self.keybindings = collections.OrderedDict()
|
||||
if configdir is None:
|
||||
self._configfile = None
|
||||
@ -208,7 +208,7 @@ class KeyConfigParser(QObject):
|
||||
return sections
|
||||
|
||||
def _load_default(self):
|
||||
"""Load the built-in default keybindings."""
|
||||
"""Load the built-in default key bindings."""
|
||||
for sectname, sect in configdata.KEY_DATA.items():
|
||||
sectname = self._normalize_sectname(sectname)
|
||||
if not sect:
|
||||
@ -242,7 +242,7 @@ class KeyConfigParser(QObject):
|
||||
e.lineno = i
|
||||
raise
|
||||
except OSError:
|
||||
log.keyboard.exception("Failed to read keybindings!")
|
||||
log.keyboard.exception("Failed to read key bindings!")
|
||||
for sectname in self.keybindings:
|
||||
self.changed.emit(sectname)
|
||||
|
||||
@ -258,9 +258,9 @@ class KeyConfigParser(QObject):
|
||||
self._cur_command = line
|
||||
|
||||
def _read_keybinding(self, line):
|
||||
"""Read a keybinding from a line."""
|
||||
"""Read a key binding from a line."""
|
||||
if self._cur_command is None:
|
||||
raise KeyConfigError("Got keybinding '{}' without getting a "
|
||||
raise KeyConfigError("Got key binding '{}' without getting a "
|
||||
"command!".format(line))
|
||||
else:
|
||||
assert self._cur_section is not None
|
||||
@ -280,7 +280,7 @@ class KeyConfigParser(QObject):
|
||||
self.keybindings[sectname][keychain] = command
|
||||
|
||||
def get_bindings_for(self, section):
|
||||
"""Get a dict with all merged keybindings for a section."""
|
||||
"""Get a dict with all merged key bindings for a section."""
|
||||
bindings = {}
|
||||
for sectstring, d in self.keybindings.items():
|
||||
if sectstring.startswith('!'):
|
||||
|
@ -133,7 +133,7 @@ class ValueList(Section):
|
||||
"""This class represents a section with a list key-value settings.
|
||||
|
||||
These are settings inside sections which don't have fixed keys, but instead
|
||||
have a dynamic list of "key = value" pairs, like keybindings or
|
||||
have a dynamic list of "key = value" pairs, like key bindings or
|
||||
searchengines.
|
||||
|
||||
They basically consist of two different SettingValues.
|
||||
|
@ -94,7 +94,7 @@ class ColorDict(dict):
|
||||
log.style.exception("No color defined for {}!")
|
||||
return ''
|
||||
if isinstance(val, QColor):
|
||||
# This could happen when accidentaly declarding something as
|
||||
# This could happen when accidentally declaring something as
|
||||
# QtColor instead of Color in the config, and it'd go unnoticed as
|
||||
# the CSS is invalid then.
|
||||
raise TypeError("QColor passed to ColorDict!")
|
||||
|
@ -26,7 +26,7 @@ class SettingValue:
|
||||
|
||||
"""Base class for setting values.
|
||||
|
||||
Intended to be subclassed by config value "types".
|
||||
Intended to be sub-classed by config value "types".
|
||||
|
||||
Attributes:
|
||||
typ: A BaseType subclass instance.
|
||||
|
@ -17,7 +17,7 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with qutebrowser. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
"""Base class for vim-like keysequence parser."""
|
||||
"""Base class for vim-like key sequence parser."""
|
||||
|
||||
import re
|
||||
import functools
|
||||
@ -44,20 +44,20 @@ class BaseKeyParser(QObject):
|
||||
ambiguous: There are both a partial and a definitive match.
|
||||
none: No more matches possible.
|
||||
|
||||
Types: type of a keybinding.
|
||||
chain: execute() was called via a chain-like keybinding
|
||||
special: execute() was called via a special keybinding
|
||||
Types: type of a key binding.
|
||||
chain: execute() was called via a chain-like key binding
|
||||
special: execute() was called via a special key binding
|
||||
|
||||
do_log: Whether to log keypresses or not.
|
||||
|
||||
Attributes:
|
||||
bindings: Bound keybindings
|
||||
bindings: Bound key bindings
|
||||
special_bindings: Bound special bindings (<Foo>).
|
||||
_win_id: The window ID this keyparser is associated with.
|
||||
_warn_on_keychains: Whether a warning should be logged when binding
|
||||
keychains in a section which does not support them.
|
||||
_keystring: The currently entered key sequence
|
||||
_ambigious_timer: Timer for delayed execution with ambigious bindings.
|
||||
_ambiguous_timer: Timer for delayed execution with ambiguous bindings.
|
||||
_modename: The name of the input mode associated with this keyparser.
|
||||
_supports_count: Whether count is supported
|
||||
_supports_chains: Whether keychains are supported
|
||||
@ -78,8 +78,8 @@ class BaseKeyParser(QObject):
|
||||
supports_chains=False):
|
||||
super().__init__(parent)
|
||||
self._win_id = win_id
|
||||
self._ambigious_timer = usertypes.Timer(self, 'ambigious-match')
|
||||
self._ambigious_timer.setSingleShot(True)
|
||||
self._ambiguous_timer = usertypes.Timer(self, 'ambiguous-match')
|
||||
self._ambiguous_timer.setSingleShot(True)
|
||||
self._modename = None
|
||||
self._keystring = ''
|
||||
if supports_count is None:
|
||||
@ -248,11 +248,11 @@ class BaseKeyParser(QObject):
|
||||
|
||||
def _stop_timers(self):
|
||||
"""Stop a delayed execution if any is running."""
|
||||
if self._ambigious_timer.isActive() and self.do_log:
|
||||
if self._ambiguous_timer.isActive() and self.do_log:
|
||||
log.keyboard.debug("Stopping delayed execution.")
|
||||
self._ambigious_timer.stop()
|
||||
self._ambiguous_timer.stop()
|
||||
try:
|
||||
self._ambigious_timer.timeout.disconnect()
|
||||
self._ambiguous_timer.timeout.disconnect()
|
||||
except TypeError:
|
||||
# no connections
|
||||
pass
|
||||
@ -274,10 +274,10 @@ class BaseKeyParser(QObject):
|
||||
# execute in `time' ms
|
||||
self._debug_log("Scheduling execution of {} in {}ms".format(
|
||||
binding, time))
|
||||
self._ambigious_timer.setInterval(time)
|
||||
self._ambigious_timer.timeout.connect(
|
||||
self._ambiguous_timer.setInterval(time)
|
||||
self._ambiguous_timer.timeout.connect(
|
||||
functools.partial(self.delayed_exec, binding, count))
|
||||
self._ambigious_timer.start()
|
||||
self._ambiguous_timer.start()
|
||||
|
||||
def delayed_exec(self, command, count):
|
||||
"""Execute a delayed command.
|
||||
@ -350,7 +350,7 @@ class BaseKeyParser(QObject):
|
||||
|
||||
@pyqtSlot(str)
|
||||
def on_keyconfig_changed(self, mode):
|
||||
"""Re-read the config if a keybinding was changed."""
|
||||
"""Re-read the config if a key binding was changed."""
|
||||
if self._modename is None:
|
||||
raise AttributeError("on_keyconfig_changed called but no section "
|
||||
"defined!")
|
||||
|
@ -95,7 +95,7 @@ def maybe_leave(win_id, mode, reason=None):
|
||||
|
||||
class EventFilter(QObject):
|
||||
|
||||
"""Event filter which passes the event to the corrent ModeManager."""
|
||||
"""Event filter which passes the event to the current ModeManager."""
|
||||
|
||||
def __init__(self, parent=None):
|
||||
super().__init__(parent)
|
||||
@ -229,7 +229,7 @@ class ModeManager(QObject):
|
||||
"""
|
||||
# handle like matching KeyPress
|
||||
if event in self._releaseevents_to_pass:
|
||||
# remove all occurences
|
||||
# remove all occurrences
|
||||
self._releaseevents_to_pass = [
|
||||
e for e in self._releaseevents_to_pass if e != event]
|
||||
filter_this = False
|
||||
@ -245,7 +245,7 @@ class ModeManager(QObject):
|
||||
Args:
|
||||
mode: The name of the mode.
|
||||
handler: Handler for keyPressEvents.
|
||||
passthrough: Whether to pass keybindings in this mode through to
|
||||
passthrough: Whether to pass key bindings in this mode through to
|
||||
the widgets.
|
||||
"""
|
||||
if not isinstance(mode, usertypes.KeyMode):
|
||||
|
@ -37,7 +37,7 @@ LastPress = usertypes.enum('LastPress', ['none', 'filtertext', 'keystring'])
|
||||
|
||||
class NormalKeyParser(keyparser.CommandKeyParser):
|
||||
|
||||
"""KeyParser for normalmode with added STARTCHARS detection and more.
|
||||
"""KeyParser for normal mode with added STARTCHARS detection and more.
|
||||
|
||||
Attributes:
|
||||
_partial_timer: Timer to clear partial keypresses.
|
||||
|
@ -43,7 +43,7 @@ class MainWindow(QWidget):
|
||||
|
||||
"""The main window of qutebrowser.
|
||||
|
||||
Adds all needed components to a vbox, initializes subwidgets and connects
|
||||
Adds all needed components to a vbox, initializes sub-widgets and connects
|
||||
signals.
|
||||
|
||||
Attributes:
|
||||
@ -84,7 +84,7 @@ class MainWindow(QWidget):
|
||||
self._load_state_geometry()
|
||||
else:
|
||||
self._set_default_geometry()
|
||||
log.init.debug("Initial mainwindow geometry: {}".format(
|
||||
log.init.debug("Initial main window geometry: {}".format(
|
||||
self.geometry()))
|
||||
self._vbox = QVBoxLayout(self)
|
||||
self._vbox.setContentsMargins(0, 0, 0, 0)
|
||||
|
@ -179,7 +179,7 @@ class Command(misc.MinimalLineEditMixin, misc.CommandLineEdit):
|
||||
def on_mode_left(self, mode):
|
||||
"""Clear up when command mode was left.
|
||||
|
||||
- Clear the statusbar text if it's explicitely unfocused.
|
||||
- Clear the statusbar text if it's explicitly unfocused.
|
||||
- Clear completion selection
|
||||
- Hide completion
|
||||
|
||||
|
@ -187,7 +187,7 @@ class Prompter(QObject):
|
||||
def shutdown(self):
|
||||
"""Cancel all blocking questions.
|
||||
|
||||
Quits and removes all running eventloops.
|
||||
Quits and removes all running event loops.
|
||||
|
||||
Return:
|
||||
True if loops needed to be aborted,
|
||||
|
@ -32,7 +32,7 @@ class TextBase(QLabel):
|
||||
|
||||
Unlike QLabel, the text will get elided.
|
||||
|
||||
Eliding is loosly based on
|
||||
Eliding is loosely based on
|
||||
http://gedgedev.blogspot.ch/2010/12/elided-labels-in-qt.html
|
||||
|
||||
Attributes:
|
||||
@ -64,7 +64,7 @@ class TextBase(QLabel):
|
||||
|
||||
This update the elided text after setting the text, and also works
|
||||
around a weird QLabel redrawing bug where it doesn't redraw correctly
|
||||
when the text is empty -- we explicitely need to call repaint() to
|
||||
when the text is empty -- we explicitly need to call repaint() to
|
||||
resolve this.
|
||||
|
||||
More info:
|
||||
|
@ -40,7 +40,7 @@ class UrlText(textbase.TextBase):
|
||||
_normal_url: The normal URL to be displayed as a UrlType instance.
|
||||
_normal_url_type: The type of the normal URL as a UrlType instance.
|
||||
_hover_url: The URL we're currently hovering over.
|
||||
_ssl_errors: Whether SSL errors occured while loading.
|
||||
_ssl_errors: Whether SSL errors occurred while loading.
|
||||
|
||||
Class attributes:
|
||||
_urltype: The URL type to show currently (normal/ok/error/warn/hover).
|
||||
|
@ -48,12 +48,12 @@ class TabbedBrowser(tabwidget.TabWidget):
|
||||
"""A TabWidget with QWebViews inside.
|
||||
|
||||
Provides methods to manage tabs, convenience methods to interact with the
|
||||
current tab (cur_*) and filters signals to re-emit them when they occured
|
||||
current tab (cur_*) and filters signals to re-emit them when they occurred
|
||||
in the currently visible tab.
|
||||
|
||||
For all tab-specific signals (cur_*) emitted by a tab, this happens:
|
||||
- the signal gets filtered with _filter_signals and self.cur_* gets
|
||||
emitted if the signal occured in the current tab.
|
||||
emitted if the signal occurred in the current tab.
|
||||
|
||||
Attributes:
|
||||
_win_id: The window ID this tabbedbrowser is associated with.
|
||||
@ -331,7 +331,7 @@ class TabbedBrowser(tabwidget.TabWidget):
|
||||
url: The URL to open as QUrl or None for an empty tab.
|
||||
background: Whether to open the tab in the background.
|
||||
if None, the background-tabs setting decides.
|
||||
explicit: Whether the tab was opened explicitely.
|
||||
explicit: Whether the tab was opened explicitly.
|
||||
If this is set, the new position might be different. With
|
||||
the default settings we handle it like Chromium does:
|
||||
- Tabs from clicked links etc. are to the right of
|
||||
@ -368,7 +368,7 @@ class TabbedBrowser(tabwidget.TabWidget):
|
||||
"""Get the index of a tab to insert.
|
||||
|
||||
Args:
|
||||
explicit: Whether the tab was opened explicitely.
|
||||
explicit: Whether the tab was opened explicitly.
|
||||
|
||||
Return:
|
||||
The index of the new tab.
|
||||
@ -590,7 +590,7 @@ class TabbedBrowser(tabwidget.TabWidget):
|
||||
except TabDeletedError:
|
||||
# We can get signals for tabs we already deleted...
|
||||
return
|
||||
if tab.page().error_occured:
|
||||
if tab.page().error_occurred:
|
||||
color = config.get('colors', 'tabs.indicator.error')
|
||||
else:
|
||||
start = config.get('colors', 'tabs.indicator.start')
|
||||
|
@ -41,7 +41,7 @@ PM_TabBarPadding = QStyle.PM_CustomBase
|
||||
|
||||
class TabWidget(QTabWidget):
|
||||
|
||||
"""The tabwidget used for TabbedBrowser."""
|
||||
"""The tab widget used for TabbedBrowser."""
|
||||
|
||||
def __init__(self, win_id, parent=None):
|
||||
super().__init__(parent)
|
||||
@ -65,10 +65,10 @@ class TabWidget(QTabWidget):
|
||||
self.setMovable(config.get('tabs', 'movable'))
|
||||
self.setTabsClosable(False)
|
||||
position = config.get('tabs', 'position')
|
||||
selection_behaviour = config.get('tabs', 'select-on-remove')
|
||||
selection_behavior = config.get('tabs', 'select-on-remove')
|
||||
self.setTabPosition(position)
|
||||
tabbar.vertical = position in (QTabWidget.West, QTabWidget.East)
|
||||
tabbar.setSelectionBehaviorOnRemove(selection_behaviour)
|
||||
tabbar.setSelectionBehaviorOnRemove(selection_behavior)
|
||||
tabbar.refresh()
|
||||
|
||||
def set_tab_indicator_color(self, idx, color):
|
||||
@ -187,7 +187,7 @@ class TabWidget(QTabWidget):
|
||||
|
||||
class TabBar(QTabBar):
|
||||
|
||||
"""Custom tabbar with our own style.
|
||||
"""Custom tab bar with our own style.
|
||||
|
||||
FIXME: Dragging tabs doesn't look as nice as it does in QTabBar. However,
|
||||
fixing this would be a lot of effort, so we'll postpone it until we're
|
||||
@ -221,16 +221,16 @@ class TabBar(QTabBar):
|
||||
|
||||
@config.change_filter('tabs', 'hide-auto')
|
||||
def autohide(self):
|
||||
"""Hide tabbar if needed when tabs->hide-auto got changed."""
|
||||
"""Hide tab bar if needed when tabs->hide-auto got changed."""
|
||||
self._tabhide()
|
||||
|
||||
@config.change_filter('tabs', 'hide-always')
|
||||
def alwayshide(self):
|
||||
"""Hide tabbar if needed when tabs->hide-always got changed."""
|
||||
"""Hide tab bar if needed when tabs->hide-always got changed."""
|
||||
self._tabhide()
|
||||
|
||||
def _tabhide(self):
|
||||
"""Hide the tabbar if needed."""
|
||||
"""Hide the tab bar if needed."""
|
||||
hide_auto = config.get('tabs', 'hide-auto')
|
||||
hide_always = config.get('tabs', 'hide-always')
|
||||
if hide_always or (hide_auto and self.count() == 1):
|
||||
@ -264,7 +264,7 @@ class TabBar(QTabBar):
|
||||
|
||||
Args:
|
||||
idx: The tab index to get the title for.
|
||||
handle_unset: Whether to return an emtpy string on KeyError.
|
||||
handle_unset: Whether to return an empty string on KeyError.
|
||||
"""
|
||||
try:
|
||||
return self.tab_data(idx, 'page-title')
|
||||
@ -279,12 +279,12 @@ class TabBar(QTabBar):
|
||||
|
||||
@config.change_filter('fonts', 'tabbar')
|
||||
def set_font(self):
|
||||
"""Set the tabbar font."""
|
||||
"""Set the tab bar font."""
|
||||
self.setFont(config.get('fonts', 'tabbar'))
|
||||
|
||||
@config.change_filter('colors', 'tabs.bg.bar')
|
||||
def set_colors(self):
|
||||
"""Set the tabbar colors."""
|
||||
"""Set the tab bar colors."""
|
||||
p = self.palette()
|
||||
p.setColor(QPalette.Window, config.get('colors', 'tabs.bg.bar'))
|
||||
self.setPalette(p)
|
||||
@ -311,7 +311,7 @@ class TabBar(QTabBar):
|
||||
"""Set the minimum tab size to indicator/icon/... text.
|
||||
|
||||
Args:
|
||||
index: The index of the tab to get a sizehint for.
|
||||
index: The index of the tab to get a size hint for.
|
||||
|
||||
Return:
|
||||
A QSize.
|
||||
|
@ -149,7 +149,7 @@ class ConsoleWidget(QWidget):
|
||||
_output: The output widget in the console.
|
||||
_vbox: The layout which contains everything.
|
||||
_more: A flag which is set when more input is expected.
|
||||
_buffer: The buffer for multiline commands.
|
||||
_buffer: The buffer for multi-line commands.
|
||||
_interpreter: The InteractiveInterpreter to execute code with.
|
||||
"""
|
||||
|
||||
@ -195,13 +195,13 @@ class ConsoleWidget(QWidget):
|
||||
self._buffer.append(line)
|
||||
source = '\n'.join(self._buffer)
|
||||
self.write(line + '\n')
|
||||
# We do two special things with the contextmanagers here:
|
||||
# We do two special things with the context managers here:
|
||||
# - We replace stdout/stderr to capture output. Even if we could
|
||||
# override InteractiveInterpreter's write method, most things are
|
||||
# printed elsewhere (e.g. by exec). Other Python GUI shells do the
|
||||
# same.
|
||||
# - We disable our exception hook, so exceptions from the console get
|
||||
# printed and don't ooen a crashdialog.
|
||||
# printed and don't open a crashdialog.
|
||||
with utils.fake_io(self.write), utils.disabled_excepthook():
|
||||
self._more = self._interpreter.runsource(source, '<console>')
|
||||
self.write(self._curprompt())
|
||||
|
@ -82,7 +82,7 @@ def get_fatal_crash_dialog(debug, data):
|
||||
else:
|
||||
title = "qutebrowser was restarted after a fatal crash!"
|
||||
text = ("<b>qutebrowser was restarted after a fatal crash!</b><br/>"
|
||||
"Unfortunately, this crash occured in Qt (the library "
|
||||
"Unfortunately, this crash occurred in Qt (the library "
|
||||
"qutebrowser uses), and your version ({}) is outdated - "
|
||||
"Qt 5.4 or later is recommended. Unfortuntately Debian and "
|
||||
"Ubuntu don't ship a newer version (yet?)...".format(
|
||||
@ -403,12 +403,12 @@ class ExceptionCrashDialog(_CrashDialog):
|
||||
|
||||
class FatalCrashDialog(_CrashDialog):
|
||||
|
||||
"""Dialog which gets shown when a fatal error occured.
|
||||
"""Dialog which gets shown when a fatal error occurred.
|
||||
|
||||
Attributes:
|
||||
_log: The log text to display.
|
||||
_type: The type of error which occured.
|
||||
_func: The function (top of the stack) in which the error occured.
|
||||
_type: The type of error which occurred.
|
||||
_func: The function (top of the stack) in which the error occurred.
|
||||
_chk_history: A checkbox for the user to decide if page history should
|
||||
be sent.
|
||||
"""
|
||||
|
@ -39,7 +39,7 @@ try:
|
||||
except ImportError:
|
||||
tkinter = None
|
||||
# NOTE: No qutebrowser or PyQt import should be done here, as some early
|
||||
# initialisation needs to take place before that!
|
||||
# initialization needs to take place before that!
|
||||
|
||||
|
||||
def _missing_str(name, *, windows=None, pip=None):
|
||||
@ -97,7 +97,7 @@ def _die(message, exception=None):
|
||||
def init_faulthandler(fileobj=sys.__stderr__):
|
||||
"""Enable faulthandler module if available.
|
||||
|
||||
This print a nice traceback on segfauls.
|
||||
This print a nice traceback on segfaults.
|
||||
|
||||
We use sys.__stderr__ instead of sys.stderr here so this will still work
|
||||
when sys.stderr got replaced, e.g. by "Python Tools for Visual Studio".
|
||||
@ -163,7 +163,7 @@ def fix_harfbuzz(args):
|
||||
elif args.harfbuzz in ('old', 'new'):
|
||||
# forced harfbuzz variant
|
||||
# FIXME looking at the Qt code, 'new' isn't a valid value, but leaving
|
||||
# it empty and using new yields different behaviour...
|
||||
# it empty and using new yields different behavior...
|
||||
# (probably irrelevant when workaround gets removed)
|
||||
log.init.debug("Using {} harfbuzz engine (forced)".format(
|
||||
args.harfbuzz))
|
||||
@ -263,7 +263,7 @@ def init_log(args):
|
||||
|
||||
|
||||
def earlyinit(args):
|
||||
"""Do all needed early initialisation.
|
||||
"""Do all needed early initialization.
|
||||
|
||||
Note that it's vital the other earlyinit functions get called in the right
|
||||
order!
|
||||
@ -272,7 +272,7 @@ def earlyinit(args):
|
||||
args: The argparse namespace.
|
||||
"""
|
||||
# First we initialize the faulthandler as early as possible, so we
|
||||
# theoretically could catch segfaults occuring later during earlyinit.
|
||||
# theoretically could catch segfaults occurring later during earlyinit.
|
||||
init_faulthandler()
|
||||
# Here we check if QtCore is available, and if not, print a message to the
|
||||
# console or via Tk.
|
||||
|
@ -127,7 +127,7 @@ class _CommandValidator(QValidator):
|
||||
|
||||
Args:
|
||||
string: The string to validate.
|
||||
pos: The current curser position.
|
||||
pos: The current cursor position.
|
||||
|
||||
Return:
|
||||
A tuple (status, string, pos) as a QValidator should.
|
||||
|
@ -39,7 +39,8 @@ class Saveable:
|
||||
_save_handler: The function to call to save this Saveable.
|
||||
_save_on_exit: Whether to always save this saveable on exit.
|
||||
_config_opt: A (section, option) tuple of a config option which decides
|
||||
whether to autosave or not. None if no such option exists.
|
||||
whether to auto-save or not. None if no such option
|
||||
exists.
|
||||
_filename: The filename of the underlying file.
|
||||
"""
|
||||
|
||||
@ -77,7 +78,7 @@ class Saveable:
|
||||
|
||||
Args:
|
||||
is_exit: Whether we're currently exiting qutebrowser.
|
||||
explicit: Whether the user explicitely requested this save.
|
||||
explicit: Whether the user explicitly requested this save.
|
||||
silent: Don't write informations to log.
|
||||
force: Force saving, no matter what.
|
||||
"""
|
||||
@ -119,7 +120,7 @@ class SaveManager(QObject):
|
||||
return utils.get_repr(self, saveables=self.saveables)
|
||||
|
||||
def init_autosave(self):
|
||||
"""Initialize autosaving.
|
||||
"""Initialize auto-saving.
|
||||
|
||||
We don't do this in __init__ because the config needs to be initialized
|
||||
first, but the config needs the save manager.
|
||||
@ -129,7 +130,7 @@ class SaveManager(QObject):
|
||||
|
||||
@config.change_filter('general', 'auto-save-interval')
|
||||
def set_autosave_interval(self):
|
||||
"""Set the autosave interval."""
|
||||
"""Set the auto-save interval."""
|
||||
interval = config.get('general', 'auto-save-interval')
|
||||
if interval == 0:
|
||||
self._save_timer.stop()
|
||||
@ -145,7 +146,7 @@ class SaveManager(QObject):
|
||||
name: The name to use.
|
||||
save: The function to call to save this saveable.
|
||||
changed: The signal emitted when this saveable changed.
|
||||
config_opt: A (section, option) tuple deciding whether to autosave
|
||||
config_opt: A (section, option) tuple deciding whether to auto-save
|
||||
or not.
|
||||
filename: The filename of the underlying file, so we can force
|
||||
saving if it doesn't exist.
|
||||
@ -161,7 +162,7 @@ class SaveManager(QObject):
|
||||
|
||||
Args:
|
||||
is_exit: Whether we're currently exiting qutebrowser.
|
||||
explicit: Whether this save operation was triggered explicitely.
|
||||
explicit: Whether this save operation was triggered explicitly.
|
||||
silent: Don't write informations to log. Used to reduce log spam
|
||||
when autosaving.
|
||||
force: Force saving, no matter what.
|
||||
|
@ -49,7 +49,7 @@ class ShellLexer:
|
||||
self.reset()
|
||||
|
||||
def reset(self):
|
||||
"""Reset the statemachine state to the defaults."""
|
||||
"""Reset the state machine state to the defaults."""
|
||||
self.quoted = False
|
||||
self.escapedstate = ' '
|
||||
self.token = ''
|
||||
@ -190,7 +190,7 @@ def simple_split(s, keep=False, maxsplit=None):
|
||||
whitespace = '\n\t '
|
||||
if maxsplit == 0:
|
||||
# re.split with maxsplit=0 splits everything, while str.split splits
|
||||
# nothing (which is the behaviour we want).
|
||||
# nothing (which is the behavior we want).
|
||||
if keep:
|
||||
return [s]
|
||||
else:
|
||||
|
@ -133,7 +133,7 @@ def main():
|
||||
"""
|
||||
return app.exec_()
|
||||
|
||||
# We set qApp explicitely here to reduce the risk of segfaults while
|
||||
# We set qApp explicitly here to reduce the risk of segfaults while
|
||||
# quitting.
|
||||
# See https://bugs.launchpad.net/ubuntu/+source/python-qt4/+bug/561303/comments/7
|
||||
# While this is a workaround for PyQt4 which should be fixed in PyQt, it
|
||||
|
@ -36,7 +36,7 @@ DEFAULT_NAME = 'qutebrowser-download'
|
||||
|
||||
class AttachmentTestCase(unittest.TestCase):
|
||||
|
||||
"""Helper class with some convienence methods to check filenames."""
|
||||
"""Helper class with some convenience methods to check filenames."""
|
||||
|
||||
def _check_filename(self, header, filename):
|
||||
"""Check if the passed header has the given filename."""
|
||||
@ -120,7 +120,7 @@ class InlineTests(unittest.TestCase):
|
||||
variation of the test checks whether whatever handles PDF display
|
||||
receives the filename information, and acts upon it (this was tested
|
||||
with the latest Acrobat Reader plugin, or, in the case of Chrome, using
|
||||
the builtin PDF handler).
|
||||
the built-in PDF handler).
|
||||
"""
|
||||
self._check_filename('inline; filename="foo.pdf"', "foo.pdf")
|
||||
|
||||
@ -824,7 +824,7 @@ class EncodingFallbackTests(AttachmentTestCase):
|
||||
"filename=\"foo-ae.html\"", 'foo-ä.html')
|
||||
|
||||
def test_attfnboth3(self):
|
||||
"""'attachment', specifying an ambigious filename.
|
||||
"""'attachment', specifying an ambiguous filename.
|
||||
|
||||
currency-sign=¤ in the simple RFC2231/5987 format, and euro-sign=€ in
|
||||
RFC2231-with-continuations format.
|
||||
|
@ -40,8 +40,8 @@ def get_webelem(geometry=None, frame=None, null=False, visibility='',
|
||||
geometry: The geometry of the QWebElement as QRect.
|
||||
frame: The QWebFrame the element is in.
|
||||
null: Whether the element is null or not.
|
||||
visibility: The CSS visibility style property calue.
|
||||
display: The CSS display style property calue.
|
||||
visibility: The CSS visibility style property value.
|
||||
display: The CSS display style property value.
|
||||
attributes: Boolean HTML attributes to be added.
|
||||
tagname: The tag name.
|
||||
classes: HTML classes to be added.
|
||||
@ -535,7 +535,7 @@ class IsEditableTests(unittest.TestCase):
|
||||
self.assertFalse(elem.is_editable())
|
||||
|
||||
def test_div_noneditable(self):
|
||||
"""Test div-element with non-editableclass."""
|
||||
"""Test div-element with non-editable class."""
|
||||
elem = get_webelem(tagname='div', classes='foo-kix-bar')
|
||||
self.assertFalse(elem.is_editable())
|
||||
|
||||
|
@ -1828,7 +1828,7 @@ class SearchEngineUrlTests(unittest.TestCase):
|
||||
self.t.validate('http://example.com/?q={}')
|
||||
|
||||
def test_validate_invalid_url(self):
|
||||
"""Test validate with an invalud URL."""
|
||||
"""Test validate with an invalid URL."""
|
||||
with self.assertRaises(configexc.ValidationError):
|
||||
self.t.validate(':{}')
|
||||
|
||||
|
@ -210,11 +210,11 @@ class KeyChainTests(unittest.TestCase):
|
||||
|
||||
@mock.patch('qutebrowser.keyinput.basekeyparser.config',
|
||||
new=stubs.ConfigStub(CONFIG))
|
||||
def test_ambigious_keychain(self):
|
||||
"""Test ambigious keychain."""
|
||||
timer = self.kp._ambigious_timer
|
||||
def test_ambiguous_keychain(self):
|
||||
"""Test ambiguous keychain."""
|
||||
timer = self.kp._ambiguous_timer
|
||||
self.assertFalse(timer.isActive())
|
||||
# We start with 'a' where the keychain gives us an ambigious result.
|
||||
# We start with 'a' where the keychain gives us an ambiguous result.
|
||||
# Then we check if the timer has been set up correctly
|
||||
self.kp.handle(helpers.fake_keyevent(Qt.Key_A, text='a'))
|
||||
self.assertFalse(self.kp.execute.called)
|
||||
|
@ -52,7 +52,7 @@ def qt_message_handler(msg_type, context, msg):
|
||||
QtFatalMsg: logging.CRITICAL,
|
||||
}
|
||||
level = qt_to_logging[msg_type]
|
||||
# There's very similiar code in utils.log, but we want it duplicated here
|
||||
# There's very similar code in utils.log, but we want it duplicated here
|
||||
# for the tests.
|
||||
if context.function is None:
|
||||
func = 'none'
|
||||
|
@ -100,7 +100,7 @@ class FileHandlingTests(unittest.TestCase):
|
||||
self.editor = editor.ExternalEditor(0)
|
||||
|
||||
def test_file_handling_closed_ok(self, _proc_mock):
|
||||
"""Test file handling when closing with an exitstatus == 0."""
|
||||
"""Test file handling when closing with an exit status == 0."""
|
||||
self.editor.edit("")
|
||||
filename = self.editor._filename
|
||||
self.assertTrue(os.path.exists(filename))
|
||||
@ -108,7 +108,7 @@ class FileHandlingTests(unittest.TestCase):
|
||||
self.assertFalse(os.path.exists(filename))
|
||||
|
||||
def test_file_handling_closed_error(self, _proc_mock):
|
||||
"""Test file handling when closing with an exitstatus != 0."""
|
||||
"""Test file handling when closing with an exit status != 0."""
|
||||
self.editor.edit("")
|
||||
filename = self.editor._filename
|
||||
self.assertTrue(os.path.exists(filename))
|
||||
|
@ -146,20 +146,20 @@ class SimpleSplitTests(unittest.TestCase):
|
||||
}
|
||||
|
||||
def test_str_split(self):
|
||||
"""Test if the behaviour matches str.split."""
|
||||
"""Test if the behavior matches str.split."""
|
||||
for test in self.TESTS:
|
||||
with self.subTest(string=test):
|
||||
self.assertEqual(split.simple_split(test),
|
||||
test.rstrip().split())
|
||||
|
||||
def test_str_split_maxsplit_1(self):
|
||||
"""Test if the behaviour matches str.split with maxsplit=1."""
|
||||
"""Test if the behavior matches str.split with maxsplit=1."""
|
||||
string = "foo bar baz"
|
||||
self.assertEqual(split.simple_split(string, maxsplit=1),
|
||||
string.rstrip().split(maxsplit=1))
|
||||
|
||||
def test_str_split_maxsplit_0(self):
|
||||
"""Test if the behaviour matches str.split with maxsplit=0."""
|
||||
"""Test if the behavior matches str.split with maxsplit=0."""
|
||||
string = " foo bar baz "
|
||||
self.assertEqual(split.simple_split(string, maxsplit=0),
|
||||
string.rstrip().split(maxsplit=0))
|
||||
|
@ -36,7 +36,7 @@ class QEnumKeyTests(unittest.TestCase):
|
||||
"""Tests for qenum_key."""
|
||||
|
||||
def test_no_metaobj(self):
|
||||
"""Test with an enum with no metaobject."""
|
||||
"""Test with an enum with no meta-object."""
|
||||
with self.assertRaises(AttributeError):
|
||||
# Make sure it doesn't have a meta object
|
||||
# pylint: disable=pointless-statement,no-member
|
||||
@ -45,9 +45,9 @@ class QEnumKeyTests(unittest.TestCase):
|
||||
self.assertEqual(key, 'PE_PanelButtonCommand')
|
||||
|
||||
def test_metaobj(self):
|
||||
"""Test with an enum with metaobject."""
|
||||
"""Test with an enum with meta-object."""
|
||||
# pylint: disable=pointless-statement
|
||||
QFrame.staticMetaObject # make sure it has a metaobject
|
||||
QFrame.staticMetaObject # make sure it has a meta-object
|
||||
key = debug.qenum_key(QFrame, QFrame.Sunken)
|
||||
self.assertEqual(key, 'Sunken')
|
||||
|
||||
|
@ -114,7 +114,7 @@ class LogFilterTests(unittest.TestCase):
|
||||
self.assertTrue(logfilter.filter(record))
|
||||
|
||||
def test_matching(self):
|
||||
"""Test if a filter lets an exactly matching logrecord through."""
|
||||
"""Test if a filter lets an exactly matching log record through."""
|
||||
logfilter = log.LogFilter(["eggs", "bacon"])
|
||||
record = self._make_record("eggs")
|
||||
self.assertTrue(logfilter.filter(record))
|
||||
|
@ -83,7 +83,7 @@ class CheckOverflowTests(unittest.TestCase):
|
||||
|
||||
|
||||
def argparser_exit(status=0, message=None): # pylint: disable=unused-argument
|
||||
"""Function to monkeypatch .exit() of the argparser so it doesn't exit."""
|
||||
"""Function to monkey-patch .exit() of the argparser so it doesn't exit."""
|
||||
raise Exception
|
||||
|
||||
|
||||
|
@ -46,7 +46,7 @@ class GetStandardDirLinuxTests(unittest.TestCase):
|
||||
|
||||
@unittest.skipUnless(sys.platform.startswith("linux"), "requires Linux")
|
||||
def test_data_explicit(self):
|
||||
"""Test data dir with XDG_DATA_HOME explicitely set."""
|
||||
"""Test data dir with XDG_DATA_HOME explicitly set."""
|
||||
with helpers.environ_set_temp({'XDG_DATA_HOME': self.temp_dir}):
|
||||
standarddir.init(None)
|
||||
expected = os.path.join(self.temp_dir, 'qutebrowser')
|
||||
@ -54,7 +54,7 @@ class GetStandardDirLinuxTests(unittest.TestCase):
|
||||
|
||||
@unittest.skipUnless(sys.platform.startswith("linux"), "requires Linux")
|
||||
def test_config_explicit(self):
|
||||
"""Test config dir with XDG_CONFIG_HOME explicitely set."""
|
||||
"""Test config dir with XDG_CONFIG_HOME explicitly set."""
|
||||
with helpers.environ_set_temp({'XDG_CONFIG_HOME': self.temp_dir}):
|
||||
standarddir.init(None)
|
||||
expected = os.path.join(self.temp_dir, 'qutebrowser')
|
||||
@ -62,7 +62,7 @@ class GetStandardDirLinuxTests(unittest.TestCase):
|
||||
|
||||
@unittest.skipUnless(sys.platform.startswith("linux"), "requires Linux")
|
||||
def test_cache_explicit(self):
|
||||
"""Test cache dir with XDG_CACHE_HOME explicitely set."""
|
||||
"""Test cache dir with XDG_CACHE_HOME explicitly set."""
|
||||
with helpers.environ_set_temp({'XDG_CACHE_HOME': self.temp_dir}):
|
||||
standarddir.init(None)
|
||||
expected = os.path.join(self.temp_dir, 'qutebrowser')
|
||||
|
@ -71,7 +71,7 @@ class ReadFileTests(unittest.TestCase):
|
||||
"""Test read_file."""
|
||||
|
||||
def test_readfile(self):
|
||||
"""Read a testfile."""
|
||||
"""Read a test file."""
|
||||
content = utils.read_file(os.path.join('test', 'testfile'))
|
||||
self.assertEqual(content.splitlines()[0], "Hello World!")
|
||||
|
||||
@ -299,13 +299,13 @@ class KeyEventToStringTests(unittest.TestCase):
|
||||
"""Test keyevent_to_string."""
|
||||
|
||||
def test_only_control(self):
|
||||
"""Test keyeevent when only control is pressed."""
|
||||
"""Test keyevent when only control is pressed."""
|
||||
evt = helpers.fake_keyevent(key=Qt.Key_Control,
|
||||
modifiers=Qt.ControlModifier)
|
||||
self.assertIsNone(utils.keyevent_to_string(evt))
|
||||
|
||||
def test_only_hyper_l(self):
|
||||
"""Test keyeevent when only Hyper_L is pressed."""
|
||||
"""Test keyevent when only Hyper_L is pressed."""
|
||||
evt = helpers.fake_keyevent(key=Qt.Key_Hyper_L,
|
||||
modifiers=Qt.MetaModifier)
|
||||
self.assertIsNone(utils.keyevent_to_string(evt))
|
||||
@ -423,7 +423,7 @@ class ForceEncodingTests(unittest.TestCase):
|
||||
"""Test force_encoding."""
|
||||
|
||||
def test_fitting_ascii(self):
|
||||
"""Test with a text fitting into ascii."""
|
||||
"""Test with a text fitting into ASCII."""
|
||||
text = 'hello world'
|
||||
self.assertEqual(utils.force_encoding(text, 'ascii'), text)
|
||||
|
||||
@ -433,7 +433,7 @@ class ForceEncodingTests(unittest.TestCase):
|
||||
self.assertEqual(utils.force_encoding(text, 'utf-8'), text)
|
||||
|
||||
def test_not_fitting_ascii(self):
|
||||
"""Test with a text not fitting into ascii."""
|
||||
"""Test with a text not fitting into ASCII."""
|
||||
text = 'hellö wörld'
|
||||
self.assertEqual(utils.force_encoding(text, 'ascii'), 'hell? w?rld')
|
||||
|
||||
|
@ -245,14 +245,14 @@ class BlockTests(unittest.TestCase):
|
||||
mode=usertypes.NeighborList.Modes.block)
|
||||
|
||||
def test_first(self):
|
||||
"""Test ouf of bounds previtem()."""
|
||||
"""Test out of bounds previtem()."""
|
||||
self.nl.firstitem()
|
||||
self.assertEqual(self.nl._idx, 0)
|
||||
self.assertEqual(self.nl.previtem(), 1)
|
||||
self.assertEqual(self.nl._idx, 0)
|
||||
|
||||
def test_last(self):
|
||||
"""Test ouf of bounds nextitem()."""
|
||||
"""Test out of bounds nextitem()."""
|
||||
self.nl.lastitem()
|
||||
self.assertEqual(self.nl._idx, 4)
|
||||
self.assertEqual(self.nl.nextitem(), 5)
|
||||
@ -272,14 +272,14 @@ class WrapTests(unittest.TestCase):
|
||||
[1, 2, 3, 4, 5], default=3, mode=usertypes.NeighborList.Modes.wrap)
|
||||
|
||||
def test_first(self):
|
||||
"""Test ouf of bounds previtem()."""
|
||||
"""Test out of bounds previtem()."""
|
||||
self.nl.firstitem()
|
||||
self.assertEqual(self.nl._idx, 0)
|
||||
self.assertEqual(self.nl.previtem(), 5)
|
||||
self.assertEqual(self.nl._idx, 4)
|
||||
|
||||
def test_last(self):
|
||||
"""Test ouf of bounds nextitem()."""
|
||||
"""Test out of bounds nextitem()."""
|
||||
self.nl.lastitem()
|
||||
self.assertEqual(self.nl._idx, 4)
|
||||
self.assertEqual(self.nl.nextitem(), 1)
|
||||
@ -300,7 +300,7 @@ class RaiseTests(unittest.TestCase):
|
||||
mode=usertypes.NeighborList.Modes.exception)
|
||||
|
||||
def test_first(self):
|
||||
"""Test ouf of bounds previtem()."""
|
||||
"""Test out of bounds previtem()."""
|
||||
self.nl.firstitem()
|
||||
self.assertEqual(self.nl._idx, 0)
|
||||
with self.assertRaises(IndexError):
|
||||
@ -308,7 +308,7 @@ class RaiseTests(unittest.TestCase):
|
||||
self.assertEqual(self.nl._idx, 0)
|
||||
|
||||
def test_last(self):
|
||||
"""Test ouf of bounds nextitem()."""
|
||||
"""Test out of bounds nextitem()."""
|
||||
self.nl.lastitem()
|
||||
self.assertEqual(self.nl._idx, 4)
|
||||
with self.assertRaises(IndexError):
|
||||
|
@ -49,7 +49,7 @@ class Loader(jinja2.BaseLoader):
|
||||
|
||||
|
||||
def _guess_autoescape(template_name):
|
||||
"""Turn autoescape on/off based on the filetype.
|
||||
"""Turn auto-escape on/off based on the file type.
|
||||
|
||||
Based on http://jinja.pocoo.org/docs/dev/api/#autoescaping
|
||||
"""
|
||||
|
@ -77,7 +77,7 @@ def _from_args(typ, args):
|
||||
Return:
|
||||
A (override, path) tuple.
|
||||
override: boolean, if the user did override the path
|
||||
path: The overriden path, or None to turn off storage.
|
||||
path: The overridden path, or None to turn off storage.
|
||||
"""
|
||||
typ_to_argparse_arg = {
|
||||
QStandardPaths.ConfigLocation: 'confdir'
|
||||
|
@ -148,7 +148,7 @@ def fuzzy_url(urlstr, cwd=None, relative=False, do_search=True):
|
||||
do_search: Whether to perform a search on non-URLs.
|
||||
|
||||
Return:
|
||||
A target QUrl to a searchpage or the original URL.
|
||||
A target QUrl to a search page or the original URL.
|
||||
"""
|
||||
expanded = os.path.expanduser(urlstr)
|
||||
if relative and cwd:
|
||||
|
@ -17,7 +17,7 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with qutebrowser. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
"""Custom useful datatypes.
|
||||
"""Custom useful data types.
|
||||
|
||||
Module attributes:
|
||||
_UNSET: Used as default argument in the constructor so default can be None.
|
||||
@ -40,7 +40,7 @@ def enum(name, items, start=1, is_int=False):
|
||||
|
||||
Args:
|
||||
name: Name of the enum
|
||||
items: Iterable of ttems to be sequentally enumerated.
|
||||
items: Iterable of items to be sequentially enumerated.
|
||||
start: The number to use for the first value.
|
||||
We use 1 as default so enum members are always True.
|
||||
is_init: True if the enum should be a Python IntEnum
|
||||
@ -309,7 +309,7 @@ class Question(QObject):
|
||||
|
||||
@pyqtSlot()
|
||||
def done(self):
|
||||
"""Must be called when the queston was answered completely."""
|
||||
"""Must be called when the question was answered completely."""
|
||||
self.answered.emit(self.answer)
|
||||
if self.mode == PromptMode.yesno:
|
||||
if self.answer:
|
||||
|
@ -95,7 +95,7 @@ def read_file(filename, binary=False):
|
||||
def actute_warning():
|
||||
"""Display a warning about the dead_actute issue if needed."""
|
||||
# WORKAROUND (remove this when we bump the requirements to 5.3.0)
|
||||
# Non linux OS' aren't affected
|
||||
# Non Linux OS' aren't affected
|
||||
if not sys.platform.startswith('linux'):
|
||||
return
|
||||
# If no compose file exists for some reason, we're not affected
|
||||
@ -151,7 +151,7 @@ def interpolate_color(start, end, percent, colorspace=QColor.Rgb):
|
||||
start: The start color.
|
||||
end: The end color.
|
||||
percent: Which value to get (0 - 100)
|
||||
colorspace: The desired interpolation colorsystem,
|
||||
colorspace: The desired interpolation color system,
|
||||
QColor::{Rgb,Hsv,Hsl} (from QColor::Spec enum)
|
||||
|
||||
Return:
|
||||
@ -435,7 +435,7 @@ class prevent_exceptions: # pylint: disable=invalid-name
|
||||
silently ignores them.
|
||||
|
||||
We used to re-raise the exception with a single-shot QTimer in a similar
|
||||
case, but that lead to a strange proble with a KeyError with some random
|
||||
case, but that lead to a strange problem with a KeyError with some random
|
||||
jinja template stuff as content. For now, we only log it, so it doesn't
|
||||
pass 100% silently.
|
||||
|
||||
|
@ -34,7 +34,7 @@ from scripts import utils
|
||||
|
||||
|
||||
def check_git():
|
||||
"""Check for uncommited git files.."""
|
||||
"""Check for uncommitted git files.."""
|
||||
if not os.path.isdir(".git"):
|
||||
print("No .git dir, ignoring")
|
||||
print()
|
||||
|
@ -74,7 +74,7 @@ def main():
|
||||
('http://www.binpress.com/', False),
|
||||
('http://david.li/flow/', False),
|
||||
('https://imzdl.com/', False),
|
||||
# not reproducable
|
||||
# not reproducible
|
||||
# https://bugreports.qt-project.org/browse/QTBUG-39847
|
||||
('http://www.20min.ch/', True),
|
||||
# HarfBuzz, https://bugreports.qt-project.org/browse/QTBUG-39278
|
||||
|
@ -61,7 +61,7 @@ term_attributes = {
|
||||
|
||||
|
||||
def _esc(code):
|
||||
"""Get an ANSII color code based on a color number."""
|
||||
"""Get an ANSI color code based on a color number."""
|
||||
return '\033[{}m'.format(code)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user