[Lint] Fix spelling mistakes

A quick fix of some of the mistakes caught by codespell.
Updated readme with new IRC server

Useful to add it as part of linting checks.
This commit is contained in:
Calum Lind 2021-09-21 21:40:13 +01:00
parent d8526ba653
commit 1e6cc03946
29 changed files with 54 additions and 51 deletions

View File

@ -4,7 +4,7 @@
Deluge is a BitTorrent client that utilizes a daemon/client model. Deluge is a BitTorrent client that utilizes a daemon/client model.
It has various user interfaces available such as the GTK-UI, Web-UI and It has various user interfaces available such as the GTK-UI, Web-UI and
a Console-UI. It uses [libtorrent][lt] at it's core to handle the BitTorrent Console-UI. It uses [libtorrent][lt] at its core to handle the BitTorrent
protocol. protocol.
## Install ## Install
@ -58,7 +58,7 @@ See the [Thinclient guide] to connect to the daemon from another computer.
- [Homepage](https://deluge-torrent.org) - [Homepage](https://deluge-torrent.org)
- [User guide][user guide] - [User guide][user guide]
- [Forum](https://forum.deluge-torrent.org) - [Forum](https://forum.deluge-torrent.org)
- [IRC Freenode #deluge](irc://irc.freenode.net/deluge) - [IRC Libera.Chat #deluge](irc://irc.libera.chat/deluge)
[user guide]: https://dev.deluge-torrent.org/wiki/UserGuide [user guide]: https://dev.deluge-torrent.org/wiki/UserGuide
[thinclient guide]: https://dev.deluge-torrent.org/wiki/UserGuide/ThinClient [thinclient guide]: https://dev.deluge-torrent.org/wiki/UserGuide/ThinClient

View File

@ -264,7 +264,7 @@ class ArgParserBase(argparse.ArgumentParser):
args = [a for a in args if a not in withhold] args = [a for a in args if a not in withhold]
options, remaining = super(ArgParserBase, self).parse_known_args(args=args) options, remaining = super(ArgParserBase, self).parse_known_args(args=args)
options.remaining = remaining options.remaining = remaining
# Hanlde common and process group options # Handle common and process group options
return self._handle_ui_options(options) return self._handle_ui_options(options)
def _handle_ui_options(self, options): def _handle_ui_options(self, options):

View File

@ -436,7 +436,7 @@ def fsize(fsize_b, precision=1, shortform=False):
'110 KiB' '110 KiB'
Note: Note:
This function has been refactored for perfomance with the This function has been refactored for performance with the
fsize units being translated outside the function. fsize units being translated outside the function.
""" """
@ -571,7 +571,7 @@ def ftime(secs):
'6h 23m' '6h 23m'
Note: Note:
This function has been refactored for perfomance. This function has been refactored for performance.
""" """

View File

@ -293,7 +293,8 @@ class ComponentRegistry(object):
obj (Component): a component object to deregister obj (Component): a component object to deregister
Returns: Returns:
Deferred: a deferred object that will fire once the Component has been sucessfully deregistered Deferred: a deferred object that will fire once the Component has been
successfully deregistered
""" """
if obj in self.components.values(): if obj in self.components.values():

View File

@ -101,7 +101,7 @@ class AuthManager(component.Component):
int: The auth level for this user. int: The auth level for this user.
Raises: Raises:
AuthenticationRequired: If aditional details are required to authenticate. AuthenticationRequired: If additional details are required to authenticate.
BadLoginError: If the username does not exist or password does not match. BadLoginError: If the username does not exist or password does not match.
""" """

View File

@ -267,7 +267,7 @@ class Core(component.Component):
version (str): The version string in PEP440 dotted notation. version (str): The version string in PEP440 dotted notation.
Returns: Returns:
str: The formattted peer_id with Deluge prefix e.g. '--DE200s--' str: The formatted peer_id with Deluge prefix e.g. '--DE200s--'
""" """
split = deluge.common.VersionSplit(version) split = deluge.common.VersionSplit(version)
@ -456,7 +456,7 @@ class Core(component.Component):
return result return result
d = self.torrentmanager.prefetch_metadata(magnet, timeout) d = self.torrentmanager.prefetch_metadata(magnet, timeout)
# Use a seperate callback chain to handle existing prefetching magnet. # Use a separate callback chain to handle existing prefetching magnet.
result_d = defer.Deferred() result_d = defer.Deferred()
d.addBoth(on_metadata, result_d) d.addBoth(on_metadata, result_d)
return result_d return result_d
@ -747,7 +747,7 @@ class Core(component.Component):
import traceback import traceback
traceback.print_exc() traceback.print_exc()
# Torrent was probaly removed meanwhile # Torrent was probably removed meanwhile
return {} return {}
# Ask the plugin manager to fill in the plugin keys # Ask the plugin manager to fill in the plugin keys

View File

@ -431,14 +431,14 @@ class Torrent(object):
# Setting the priorites for all the pieces of this torrent # Setting the priorites for all the pieces of this torrent
self.handle.prioritize_pieces(priorities) self.handle.prioritize_pieces(priorities)
def set_sequential_download(self, set_sequencial): def set_sequential_download(self, sequential):
"""Sets whether to download the pieces of the torrent in order. """Sets whether to download the pieces of the torrent in order.
Args: Args:
set_sequencial (bool): Enable sequencial downloading. sequential (bool): Enable sequential downloading.
""" """
self.options['sequential_download'] = set_sequencial self.options['sequential_download'] = sequential
self.handle.set_sequential_download(set_sequencial) self.handle.set_sequential_download(sequential)
def set_auto_managed(self, auto_managed): def set_auto_managed(self, auto_managed):
"""Set auto managed mode, i.e. will be started or queued automatically. """Set auto managed mode, i.e. will be started or queued automatically.
@ -1393,7 +1393,7 @@ class Torrent(object):
This basically does a file rename on all of the folders children. This basically does a file rename on all of the folders children.
Args: Args:
folder (str): The orignal folder name folder (str): The original folder name
new_folder (str): The new folder name new_folder (str): The new folder name
Returns: Returns:

View File

@ -96,7 +96,7 @@ class TorrentState: # pylint: disable=old-style-class
super_seeding=False, super_seeding=False,
name=None, name=None,
): ):
# Build the class atrribute list from args # Build the class attribute list from args
for key, value in locals().items(): for key, value in locals().items():
if key == 'self': if key == 'self':
continue continue
@ -654,7 +654,7 @@ class TorrentManager(component.Component):
# Resume AlertManager if paused for adding torrent to libtorrent. # Resume AlertManager if paused for adding torrent to libtorrent.
component.resume('AlertManager') component.resume('AlertManager')
# Store the orignal resume_data, in case of errors. # Store the original resume_data, in case of errors.
if resume_data: if resume_data:
self.resume_data[torrent.torrent_id] = resume_data self.resume_data[torrent.torrent_id] = resume_data
@ -1037,7 +1037,7 @@ class TorrentManager(component.Component):
) )
def on_torrent_resume_save(dummy_result, torrent_id): def on_torrent_resume_save(dummy_result, torrent_id):
"""Recieved torrent resume_data alert so remove from waiting list""" """Received torrent resume_data alert so remove from waiting list"""
self.waiting_on_resume_data.pop(torrent_id, None) self.waiting_on_resume_data.pop(torrent_id, None)
deferreds = [] deferreds = []

View File

@ -56,7 +56,7 @@ def overrides(*args):
if inspect.isfunction(args[0]): if inspect.isfunction(args[0]):
return _overrides(stack, args[0]) return _overrides(stack, args[0])
else: else:
# One or more classes are specifed, so return a function that will be # One or more classes are specified, so return a function that will be
# called with the real function as argument # called with the real function as argument
def ret_func(func, **kwargs): def ret_func(func, **kwargs):
return _overrides(stack, func, explicit_base_classes=args) return _overrides(stack, func, explicit_base_classes=args)
@ -107,7 +107,7 @@ def _overrides(stack, method, explicit_base_classes=None):
for c in base_classes + check_classes: for c in base_classes + check_classes:
classes[c] = get_class(c) classes[c] = get_class(c)
# Verify that the excplicit override class is one of base classes # Verify that the explicit override class is one of base classes
if explicit_base_classes: if explicit_base_classes:
from itertools import product from itertools import product
@ -146,7 +146,7 @@ def _overrides(stack, method, explicit_base_classes=None):
def deprecated(func): def deprecated(func):
"""This is a decorator which can be used to mark function as deprecated. """This is a decorator which can be used to mark function as deprecated.
It will result in a warning being emmitted when the function is used. It will result in a warning being emitted when the function is used.
""" """

View File

@ -218,7 +218,7 @@ class TwistedLoggingObserver(PythonLoggingObserver):
def tweak_logging_levels(): def tweak_logging_levels():
"""This function allows tweaking the logging levels for all or some loggers. """This function allows tweaking the logging levels for all or some loggers.
This is mostly usefull for developing purposes hence the contents of the This is mostly useful for developing purposes hence the contents of the
file are NOT like regular deluge config file's. file are NOT like regular deluge config file's.
To use is, create a file named "logging.conf" on your Deluge's config dir To use is, create a file named "logging.conf" on your Deluge's config dir

View File

@ -129,7 +129,7 @@ class PluginManagerBase(object):
""" """
if plugin_name not in self.available_plugins: if plugin_name not in self.available_plugins:
log.warning('Cannot enable non-existant plugin %s', plugin_name) log.warning('Cannot enable non-existent plugin %s', plugin_name)
return defer.succeed(False) return defer.succeed(False)
if plugin_name in self.plugins: if plugin_name in self.plugins:
@ -243,7 +243,7 @@ class PluginManagerBase(object):
del self.plugins[name] del self.plugins[name]
self.config['enabled_plugins'].remove(name) self.config['enabled_plugins'].remove(name)
except Exception as ex: except Exception as ex:
log.warning('Problems occured disabling plugin: %s', name) log.warning('Problems occurred disabling plugin: %s', name)
log.debug(ex) log.debug(ex)
ret = False ret = False
else: else:
@ -260,7 +260,7 @@ class PluginManagerBase(object):
cont_lines = [] cont_lines = []
# Missing plugin info # Missing plugin info
if not self.pkg_env[name]: if not self.pkg_env[name]:
log.warning('Failed to retrive info for plugin: %s', name) log.warning('Failed to retrieve info for plugin: %s', name)
for k in info: for k in info:
info[k] = 'not available' info[k] = 'not available'
return info return info

View File

@ -90,7 +90,7 @@ class LabelSidebarMenu(object):
for item in self.items: for item in self.items:
item.set_sensitive(sensitive) item.set_sensitive(sensitive)
# add is allways enabled. # add is always enabled.
self.item_add.set_sensitive(True) self.item_add.set_sensitive(True)
else: else:
# not a label -->hide everything. # not a label -->hide everything.

View File

@ -28,8 +28,8 @@ class DelugeTransferProtocol(Protocol, object):
""" """
Deluge RPC wire protocol. Deluge RPC wire protocol.
Data messages are transfered with a header containing a protocol version Data messages are transferred with a header containing a protocol version
and the length of the data to be transfered (payload). and the length of the data to be transferred (payload).
The format is:: The format is::
@ -51,7 +51,7 @@ class DelugeTransferProtocol(Protocol, object):
""" """
Transfer the data. Transfer the data.
:param data: data to be transfered in a data structure serializable by rencode. :param data: data to be transferred in a data structure serializable by rencode.
""" """
body = zlib.compress(rencode.dumps(data)) body = zlib.compress(rencode.dumps(data))
body_len = len(body) body_len = len(body)
@ -68,8 +68,8 @@ class DelugeTransferProtocol(Protocol, object):
""" """
This method is called whenever data is received. This method is called whenever data is received.
:param data: a message as transfered by transfer_message, or a part of such :param data: a message as transferred by transfer_message, or a part of such
a messsage. a message.
Global variables: Global variables:
_buffer - contains the data received _buffer - contains the data received
@ -120,7 +120,7 @@ class DelugeTransferProtocol(Protocol, object):
def _handle_complete_message(self, data): def _handle_complete_message(self, data):
""" """
Handles a complete message as it is transfered on the network. Handles a complete message as it is transferred on the network.
:param data: a zlib compressed string encoded with rencode. :param data: a zlib compressed string encoded with rencode.

View File

@ -65,7 +65,7 @@ class DelugeRPCRequest(object):
Returns a properly formatted RPCRequest based on the properties. Will Returns a properly formatted RPCRequest based on the properties. Will
raise a TypeError if the properties haven't been set yet. raise a TypeError if the properties haven't been set yet.
:returns: a properly formated RPCRequest :returns: a properly formatted RPCRequest
""" """
if ( if (
self.request_id is None self.request_id is None
@ -150,7 +150,7 @@ class DelugeRPCProtocol(DelugeTransferProtocol):
# so it could pass back to the 2nd deferred on the chain. But, # so it could pass back to the 2nd deferred on the chain. But,
# that does not always happen. # that does not always happen.
# So, just do some instance checking and just log rpc error at # So, just do some instance checking and just log rpc error at
# diferent levels. # different levels.
r = self.__rpc_requests[request_id] r = self.__rpc_requests[request_id]
msg = 'RPCError Message Received!' msg = 'RPCError Message Received!'
msg += '\n' + '-' * 80 msg += '\n' + '-' * 80
@ -168,7 +168,7 @@ class DelugeRPCProtocol(DelugeTransferProtocol):
# Let's log these as errors # Let's log these as errors
log.error(msg) log.error(msg)
else: else:
# The rest just get's logged in debug level, just to log # The rest just gets logged in debug level, just to log
# what's happening # what's happening
log.debug(msg) log.debug(msg)
except Exception: except Exception:

View File

@ -70,7 +70,9 @@ class Command(BaseCommand):
def on_removed_finished(errors): def on_removed_finished(errors):
if errors: if errors:
self.console.write('Error(s) occured when trying to delete torrent(s).') self.console.write(
'Error(s) occurred when trying to delete torrent(s).'
)
for t_id, e_msg in errors: for t_id, e_msg in errors:
self.console.write('Error removing torrent %s : %s' % (t_id, e_msg)) self.console.write('Error removing torrent %s : %s' % (t_id, e_msg))

View File

@ -23,7 +23,7 @@ class OptionParserError(Exception):
class ConsoleBaseParser(argparse.ArgumentParser): class ConsoleBaseParser(argparse.ArgumentParser):
def format_help(self): def format_help(self):
"""Differs from ArgumentParser.format_help by adding the raw epilog """Differs from ArgumentParser.format_help by adding the raw epilog
as formatted in the string. Default bahavior mangles the formatting. as formatted in the string. Default behavior mangles the formatting.
""" """
# Handle epilog manually to keep the text formatting # Handle epilog manually to keep the text formatting

View File

@ -449,7 +449,7 @@ class FilesTab(Tab):
try: try:
value = completed_bytes / self.treestore[parent][1] * 100 value = completed_bytes / self.treestore[parent][1] * 100
except ZeroDivisionError: except ZeroDivisionError:
# Catch the unusal error found when moving folders around # Catch the unusual error found when moving folders around
value = 0 value = 0
self.treestore[parent][3] = value self.treestore[parent][3] = value
self.treestore[parent][2] = '%i%%' % value self.treestore[parent][2] = '%i%%' % value

View File

@ -224,7 +224,7 @@ class FilterTreeView(component.Component):
label = decode_bytes(model.get_value(row, 2)) label = decode_bytes(model.get_value(row, 2))
count = model.get_value(row, 3) count = model.get_value(row, 3)
# Supress Warning: g_object_set_qdata: assertion `G_IS_OBJECT (object)' failed # Suppress Warning: g_object_set_qdata: assertion `G_IS_OBJECT (object)' failed
original_filters = warnings.filters[:] original_filters = warnings.filters[:]
warnings.simplefilter('ignore') warnings.simplefilter('ignore')
try: try:

View File

@ -2204,7 +2204,7 @@ used sparingly.</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="receives_default">False</property> <property name="receives_default">False</property>
<property name="tooltip_text" translatable="yes">Torrents not transfering any data do not count towards download/seeding active count.</property> <property name="tooltip_text" translatable="yes">Torrents not transferring any data do not count towards download/seeding active count.</property>
<property name="halign">start</property> <property name="halign">start</property>
<property name="draw_indicator">True</property> <property name="draw_indicator">True</property>
</object> </object>

View File

@ -221,7 +221,7 @@ class GtkUI(object):
menubar_osx(self, self.osxapp) menubar_osx(self, self.osxapp)
self.osxapp.ready() self.osxapp.ready()
# Initalize the plugins # Initialize the plugins
self.plugins = PluginManager() self.plugins = PluginManager()
# Show the connection manager # Show the connection manager

View File

@ -112,7 +112,7 @@ class ListView(object):
Gtk.TreeViewColumn.set_visible(self, visible) Gtk.TreeViewColumn.set_visible(self, visible)
if self.data_func: if self.data_func:
if not visible: if not visible:
# Set data function to None to prevent unecessary calls when column is hidden # Set data function to None to prevent unnecessary calls when column is hidden
self.set_cell_data_func(self.cell_renderer, None, func_data=None) self.set_cell_data_func(self.cell_renderer, None, func_data=None)
else: else:
self.set_cell_data_func( self.set_cell_data_func(

View File

@ -110,7 +110,7 @@ class StatusTab(Tab):
if decode_bytes(widget[0].get_text()) != txt: if decode_bytes(widget[0].get_text()) != txt:
widget[0].set_text(txt) widget[0].set_text(txt)
# Update progress bar seperately as it's a special case (not a label). # Update progress bar separately as it's a special case (not a label).
fraction = status['progress'] / 100 fraction = status['progress'] / 100
if self.config['show_piecesbar']: if self.config['show_piecesbar']:

View File

@ -102,7 +102,7 @@ class HostList(object):
self.config.save() self.config.save()
def check_info_exists(self, hostname, port, username, skip_host_id=None): def check_info_exists(self, hostname, port, username, skip_host_id=None):
"""Check for exising host entries with the same details. """Check for existing host entries with the same details.
Args: Args:
hostname (str): The IP or hostname of the deluge daemon. hostname (str): The IP or hostname of the deluge daemon.

View File

@ -60,7 +60,7 @@ def make_expires(timeout):
class Auth(JSONComponent): class Auth(JSONComponent):
""" """
The component that implements authentification into the JSON interface. The component that implements authentication into the JSON interface.
""" """
def __init__(self, config): def __init__(self, config):

View File

@ -653,7 +653,7 @@ class DelugeWeb(component.Component):
Args: Args:
options (argparse.Namespace): The web server options. options (argparse.Namespace): The web server options.
daemon (bool): If True run web server as a seperate daemon process (starts a twisted daemon (bool): If True run web server as a separate daemon process (starts a twisted
reactor). If False shares the process and twisted reactor from WebUI plugin or tests. reactor). If False shares the process and twisted reactor from WebUI plugin or tests.
""" """
@ -698,7 +698,7 @@ class DelugeWeb(component.Component):
self.auth = Auth(self.config) self.auth = Auth(self.config)
self.daemon = daemon self.daemon = daemon
# Initalize the plugins # Initialize the plugins
self.plugins = PluginManager() self.plugins = PluginManager()
def _on_language_changed(self, key, value): def _on_language_changed(self, key, value):

View File

@ -10,7 +10,7 @@ deluge-console - A BitTorrent client console interface
Deluge utilizes a client/server model, with \fBdeluged\fR being the daemon process and \fBdeluge-console\fR being used to launch a curses console user-interface. Deluge utilizes a client/server model, with \fBdeluged\fR being the daemon process and \fBdeluge-console\fR being used to launch a curses console user-interface.
.P .P
.SS Console Commands: .SS Console Commands:
You can pass console commands directly from the command line and use semi-colon (\fB;\fR) seperator to run multiple commands. Enclosing the commands with quotes may also be required You can pass console commands directly from the command line and use semi-colon (\fB;\fR) separator to run multiple commands. Enclosing the commands with quotes may also be required
for example: for example:
\fBdeluge-console 'add <torrent>; info <torrent_id>'\fR \fBdeluge-console 'add <torrent>; info <torrent_id>'\fR

View File

@ -255,7 +255,7 @@ MOCK_MODULES = ['deluge._libtorrent', 'xdg', 'xdg.BaseDirectory']
for mod_name in MOCK_MODULES: for mod_name in MOCK_MODULES:
sys.modules[mod_name] = Mock() sys.modules[mod_name] = Mock()
# Must add these for autodoc to import packages successully # Must add these for autodoc to import packages successfully
builtins.__dict__['_'] = lambda x: x builtins.__dict__['_'] = lambda x: x
builtins.__dict__['_n'] = lambda s, p, n: s if n == 1 else p builtins.__dict__['_n'] = lambda s, p, n: s if n == 1 else p

View File

@ -22,7 +22,7 @@ Install with pip:
pip install deluge pip install deluge
Install with all optional dependecies: Install with all optional dependencies:
pip install deluge[all] pip install deluge[all]

View File

@ -246,7 +246,7 @@ class BuildTranslations(cmd.Command):
upto_date = True upto_date = True
if upto_date: if upto_date:
sys.stdout.write(' po files already upto date. ') sys.stdout.write(' po files already up to date. ')
sys.stdout.write('\b\b \nFinished compiling translation files. \n') sys.stdout.write('\b\b \nFinished compiling translation files. \n')