Skip to content

Commit

Permalink
[Lint] Fix spelling mistakes
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
cas-- committed Sep 21, 2021
1 parent d8526ba commit 1e6cc03
Show file tree
Hide file tree
Showing 29 changed files with 54 additions and 51 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

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

## Install
Expand Down Expand Up @@ -58,7 +58,7 @@ See the [Thinclient guide] to connect to the daemon from another computer.
- [Homepage](https://deluge-torrent.org)
- [User guide][user guide]
- [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
[thinclient guide]: https://dev.deluge-torrent.org/wiki/UserGuide/ThinClient
Expand Down
2 changes: 1 addition & 1 deletion deluge/argparserbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ def parse_known_ui_args(self, args, withhold=None):
args = [a for a in args if a not in withhold]
options, remaining = super(ArgParserBase, self).parse_known_args(args=args)
options.remaining = remaining
# Hanlde common and process group options
# Handle common and process group options
return self._handle_ui_options(options)

def _handle_ui_options(self, options):
Expand Down
4 changes: 2 additions & 2 deletions deluge/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ def fsize(fsize_b, precision=1, shortform=False):
'110 KiB'
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.
"""
Expand Down Expand Up @@ -571,7 +571,7 @@ def ftime(secs):
'6h 23m'
Note:
This function has been refactored for perfomance.
This function has been refactored for performance.
"""

Expand Down
3 changes: 2 additions & 1 deletion deluge/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,8 @@ def deregister(self, obj):
obj (Component): a component object to deregister
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():
Expand Down
2 changes: 1 addition & 1 deletion deluge/core/authmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def authorize(self, username, password):
int: The auth level for this user.
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.
"""
Expand Down
6 changes: 3 additions & 3 deletions deluge/core/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ def _create_peer_id(version):
version (str): The version string in PEP440 dotted notation.
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)
Expand Down Expand Up @@ -456,7 +456,7 @@ def on_metadata(result, result_d):
return result

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()
d.addBoth(on_metadata, result_d)
return result_d
Expand Down Expand Up @@ -747,7 +747,7 @@ def create_torrent_status(
import traceback

traceback.print_exc()
# Torrent was probaly removed meanwhile
# Torrent was probably removed meanwhile
return {}

# Ask the plugin manager to fill in the plugin keys
Expand Down
10 changes: 5 additions & 5 deletions deluge/core/torrent.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,14 +431,14 @@ def get_file_piece(idx, byte_offset):
# Setting the priorites for all the pieces of this torrent
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.
Args:
set_sequencial (bool): Enable sequencial downloading.
sequential (bool): Enable sequential downloading.
"""
self.options['sequential_download'] = set_sequencial
self.handle.set_sequential_download(set_sequencial)
self.options['sequential_download'] = sequential
self.handle.set_sequential_download(sequential)

def set_auto_managed(self, auto_managed):
"""Set auto managed mode, i.e. will be started or queued automatically.
Expand Down Expand Up @@ -1393,7 +1393,7 @@ def rename_folder(self, folder, new_folder):
This basically does a file rename on all of the folders children.
Args:
folder (str): The orignal folder name
folder (str): The original folder name
new_folder (str): The new folder name
Returns:
Expand Down
6 changes: 3 additions & 3 deletions deluge/core/torrentmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def __init__(
super_seeding=False,
name=None,
):
# Build the class atrribute list from args
# Build the class attribute list from args
for key, value in locals().items():
if key == 'self':
continue
Expand Down Expand Up @@ -654,7 +654,7 @@ def _add_torrent_obj(
# Resume AlertManager if paused for adding torrent to libtorrent.
component.resume('AlertManager')

# Store the orignal resume_data, in case of errors.
# Store the original resume_data, in case of errors.
if resume_data:
self.resume_data[torrent.torrent_id] = resume_data

Expand Down Expand Up @@ -1037,7 +1037,7 @@ def save_resume_data(self, torrent_ids=None, flush_disk_cache=False):
)

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)

deferreds = []
Expand Down
6 changes: 3 additions & 3 deletions deluge/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def funcname
if inspect.isfunction(args[0]):
return _overrides(stack, args[0])
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
def ret_func(func, **kwargs):
return _overrides(stack, func, explicit_base_classes=args)
Expand Down Expand Up @@ -107,7 +107,7 @@ def get_class(cls_name):
for c in base_classes + check_classes:
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:
from itertools import product

Expand Down Expand Up @@ -146,7 +146,7 @@ def get_class(cls_name):
def deprecated(func):
"""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.
"""

Expand Down
2 changes: 1 addition & 1 deletion deluge/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def emit(self, event_dict):

def tweak_logging_levels():
"""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.
To use is, create a file named "logging.conf" on your Deluge's config dir
Expand Down
6 changes: 3 additions & 3 deletions deluge/pluginmanagerbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def enable_plugin(self, plugin_name):
"""
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)

if plugin_name in self.plugins:
Expand Down Expand Up @@ -243,7 +243,7 @@ def on_disabled(result):
del self.plugins[name]
self.config['enabled_plugins'].remove(name)
except Exception as ex:
log.warning('Problems occured disabling plugin: %s', name)
log.warning('Problems occurred disabling plugin: %s', name)
log.debug(ex)
ret = False
else:
Expand All @@ -260,7 +260,7 @@ def get_plugin_info(self, name):
cont_lines = []
# Missing plugin info
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:
info[k] = 'not available'
return info
Expand Down
2 changes: 1 addition & 1 deletion deluge/plugins/Label/deluge_label/gtkui/sidebar_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def on_show(self, widget=None, data=None):
for item in self.items:
item.set_sensitive(sensitive)

# add is allways enabled.
# add is always enabled.
self.item_add.set_sensitive(True)
else:
# not a label -->hide everything.
Expand Down
12 changes: 6 additions & 6 deletions deluge/transfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ class DelugeTransferProtocol(Protocol, object):
"""
Deluge RPC wire protocol.
Data messages are transfered with a header containing a protocol version
and the length of the data to be transfered (payload).
Data messages are transferred with a header containing a protocol version
and the length of the data to be transferred (payload).
The format is::
Expand All @@ -51,7 +51,7 @@ def transfer_message(self, 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_len = len(body)
Expand All @@ -68,8 +68,8 @@ def dataReceived(self, data): # NOQA: N802
"""
This method is called whenever data is received.
:param data: a message as transfered by transfer_message, or a part of such
a messsage.
:param data: a message as transferred by transfer_message, or a part of such
a message.
Global variables:
_buffer - contains the data received
Expand Down Expand Up @@ -120,7 +120,7 @@ def _handle_new_message(self):

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.
Expand Down
6 changes: 3 additions & 3 deletions deluge/ui/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def format_message(self):
Returns a properly formatted RPCRequest based on the properties. Will
raise a TypeError if the properties haven't been set yet.
:returns: a properly formated RPCRequest
:returns: a properly formatted RPCRequest
"""
if (
self.request_id is None
Expand Down Expand Up @@ -150,7 +150,7 @@ def message_received(self, request):
# so it could pass back to the 2nd deferred on the chain. But,
# that does not always happen.
# So, just do some instance checking and just log rpc error at
# diferent levels.
# different levels.
r = self.__rpc_requests[request_id]
msg = 'RPCError Message Received!'
msg += '\n' + '-' * 80
Expand All @@ -168,7 +168,7 @@ def message_received(self, request):
# Let's log these as errors
log.error(msg)
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
log.debug(msg)
except Exception:
Expand Down
4 changes: 3 additions & 1 deletion deluge/ui/console/cmdline/commands/rm.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ def handle(self, options):

def on_removed_finished(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:
self.console.write('Error removing torrent %s : %s' % (t_id, e_msg))

Expand Down
2 changes: 1 addition & 1 deletion deluge/ui/console/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class OptionParserError(Exception):
class ConsoleBaseParser(argparse.ArgumentParser):
def format_help(self):
"""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
Expand Down
2 changes: 1 addition & 1 deletion deluge/ui/gtk3/files_tab.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ def get_completed_bytes(row):
try:
value = completed_bytes / self.treestore[parent][1] * 100
except ZeroDivisionError:
# Catch the unusal error found when moving folders around
# Catch the unusual error found when moving folders around
value = 0
self.treestore[parent][3] = value
self.treestore[parent][2] = '%i%%' % value
Expand Down
2 changes: 1 addition & 1 deletion deluge/ui/gtk3/filtertreeview.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ def render_cell_data(self, column, cell, model, row, data):
label = decode_bytes(model.get_value(row, 2))
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[:]
warnings.simplefilter('ignore')
try:
Expand Down
2 changes: 1 addition & 1 deletion deluge/ui/gtk3/glade/preferences_dialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -2204,7 +2204,7 @@ used sparingly.</property>
<property name="visible">True</property>
<property name="can_focus">True</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="draw_indicator">True</property>
</object>
Expand Down
2 changes: 1 addition & 1 deletion deluge/ui/gtk3/gtkui.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ def nsapp_open_file(osxapp, filename):
menubar_osx(self, self.osxapp)
self.osxapp.ready()

# Initalize the plugins
# Initialize the plugins
self.plugins = PluginManager()

# Show the connection manager
Expand Down
2 changes: 1 addition & 1 deletion deluge/ui/gtk3/listview.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def set_visible(self, visible):
Gtk.TreeViewColumn.set_visible(self, visible)
if self.data_func:
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)
else:
self.set_cell_data_func(
Expand Down
2 changes: 1 addition & 1 deletion deluge/ui/gtk3/status_tab.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def _on_get_torrent_status(self, status):
if decode_bytes(widget[0].get_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

if self.config['show_piecesbar']:
Expand Down
2 changes: 1 addition & 1 deletion deluge/ui/hostlist.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def __init__(self):
self.config.save()

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:
hostname (str): The IP or hostname of the deluge daemon.
Expand Down
2 changes: 1 addition & 1 deletion deluge/ui/web/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def make_expires(timeout):

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):
Expand Down
4 changes: 2 additions & 2 deletions deluge/ui/web/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@ def __init__(self, options=None, daemon=True):
Args:
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.
"""
Expand Down Expand Up @@ -698,7 +698,7 @@ def __init__(self, options=None, daemon=True):

self.auth = Auth(self.config)
self.daemon = daemon
# Initalize the plugins
# Initialize the plugins
self.plugins = PluginManager()

def _on_language_changed(self, key, value):
Expand Down
Loading

0 comments on commit 1e6cc03

Please sign in to comment.