Various spelling fixes.

This commit is contained in:
Florian Bruhin 2015-03-31 20:49:29 +02:00
parent eb3b0b960f
commit 8ebac8d38c
72 changed files with 212 additions and 211 deletions

View File

@ -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.
...

View File

@ -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

View File

@ -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.
@ -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]+

View File

@ -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))

View File

@ -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
"""

View File

@ -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.

View File

@ -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:

View File

@ -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

View File

@ -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)

View File

@ -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.

View File

@ -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(),

View File

@ -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
@ -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:

View File

@ -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):

View File

@ -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

View File

@ -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.

View File

@ -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)

View File

@ -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

View File

@ -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]

View File

@ -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'),
@ -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 `;;`.
"""

View File

@ -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):

View File

@ -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."))

View File

@ -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."""

View 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):

View File

@ -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!")

View File

@ -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.

View File

@ -57,7 +57,7 @@ class BaseKeyParser(QObject):
_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.

View File

@ -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

View File

@ -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:

View File

@ -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

View File

@ -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:

View File

@ -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).

View File

@ -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')

View File

@ -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):
@ -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')

View File

@ -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.
"""
@ -201,7 +201,7 @@ class ConsoleWidget(QWidget):
# 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())

View File

@ -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.
"""

View File

@ -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.

View File

@ -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.

View File

@ -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.

View File

@ -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:

View File

@ -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

View File

@ -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.

View File

@ -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.

View File

@ -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(':{}')

View File

@ -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)

View File

@ -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'

View File

@ -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))

View File

@ -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')

View File

@ -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

View File

@ -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')

View File

@ -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')

View File

@ -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):

View File

@ -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
"""

View File

@ -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'

View File

@ -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:

View File

@ -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
@ -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.

View File

@ -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()

View File

@ -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

View File

@ -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)