summaryrefslogtreecommitdiffstats
path: root/deluge/ui
diff options
context:
space:
mode:
authorCalum Lind <calumlind+deluge@gmail.com>2022-02-13 12:31:41 +0000
committerCalum Lind <calumlind+deluge@gmail.com>2022-02-13 13:38:27 +0000
commit2ec6e10c8eb87a6f4e2a49afd58485adb13702a5 (patch)
tree042411bdc547f8b7f002b29b6765eff82e425957 /deluge/ui
parent2bd095e5bfc49cbe178fc0ba9df38b88afc238aa (diff)
downloaddeluge-2ec6e10c8eb87a6f4e2a49afd58485adb13702a5.tar.gz
deluge-2ec6e10c8eb87a6f4e2a49afd58485adb13702a5.tar.bz2
deluge-2ec6e10c8eb87a6f4e2a49afd58485adb13702a5.zip
[Lint] Update linter version and fix issues
Notable changes: * Prettier >=2.3 with more consistent js assignments * Black now formats docstrings * Added isort to list of autoformaters * Update flake8 config for v4 Ref: https://prettier.io/blog/2021/05/09/2.3.0.html
Diffstat (limited to 'deluge/ui')
-rw-r--r--deluge/ui/console/cmdline/commands/info.py2
-rw-r--r--deluge/ui/console/modes/basemode.py2
-rw-r--r--deluge/ui/console/utils/format_utils.py4
-rw-r--r--deluge/ui/gtk3/files_tab.py2
-rw-r--r--deluge/ui/gtk3/gtkui.py4
-rw-r--r--deluge/ui/gtk3/listview.py2
-rwxr-xr-xdeluge/ui/gtk3/path_combo_chooser.py2
-rw-r--r--deluge/ui/gtk3/piecesbar.py6
-rw-r--r--deluge/ui/gtk3/preferences.py3
-rw-r--r--deluge/ui/web/js/deluge-all/AboutWindow.js3
-rw-r--r--deluge/ui/web/js/deluge-all/AddTrackerWindow.js3
-rw-r--r--deluge/ui/web/js/deluge-all/add/OptionsPanel.js5
-rw-r--r--deluge/ui/web/js/deluge-all/preferences/BandwidthPage.js3
-rw-r--r--deluge/ui/web/js/extjs/ext-extensions/form/SpinnerGroup.js5
14 files changed, 21 insertions, 25 deletions
diff --git a/deluge/ui/console/cmdline/commands/info.py b/deluge/ui/console/cmdline/commands/info.py
index 3533e519e..7ea9a6773 100644
--- a/deluge/ui/console/cmdline/commands/info.py
+++ b/deluge/ui/console/cmdline/commands/info.py
@@ -175,7 +175,7 @@ class Command(BaseCommand):
sort_key = 'name'
sort_reverse = False
for key, value in sorted(
- list(status.items()),
+ status.items(),
key=lambda x: x[1].get(sort_key),
reverse=sort_reverse,
):
diff --git a/deluge/ui/console/modes/basemode.py b/deluge/ui/console/modes/basemode.py
index 92c699e10..5ebaf86fe 100644
--- a/deluge/ui/console/modes/basemode.py
+++ b/deluge/ui/console/modes/basemode.py
@@ -84,7 +84,7 @@ class CursesStdIO:
"""
def fileno(self):
- """ We want to select on FD 0 """
+ """We want to select on FD 0"""
return 0
def doRead(self): # NOQA: N802
diff --git a/deluge/ui/console/utils/format_utils.py b/deluge/ui/console/utils/format_utils.py
index 6c9596729..50ec1915f 100644
--- a/deluge/ui/console/utils/format_utils.py
+++ b/deluge/ui/console/utils/format_utils.py
@@ -235,11 +235,11 @@ def wrap_string(string, width, min_lines=0, strip_colors=True):
else:
cstr = s
- def append_indent(l, string, offset):
+ def append_indent(line, string, offset):
"""Prepends indent to string if specified"""
if indent and offset != 0:
string = indent + string
- l.append(string)
+ line.append(string)
while cstr:
# max with for a line. If indent is specified, we account for this
diff --git a/deluge/ui/gtk3/files_tab.py b/deluge/ui/gtk3/files_tab.py
index c8d8c0286..24c169727 100644
--- a/deluge/ui/gtk3/files_tab.py
+++ b/deluge/ui/gtk3/files_tab.py
@@ -12,7 +12,7 @@ import os.path
import gi # isort:skip (Required before Gtk import).
-gi.require_version('Gtk', '3.0') # NOQA: E402
+gi.require_version('Gtk', '3.0')
# isort:imports-thirdparty
from gi.repository import Gio, Gtk
diff --git a/deluge/ui/gtk3/gtkui.py b/deluge/ui/gtk3/gtkui.py
index abbca263e..50323d229 100644
--- a/deluge/ui/gtk3/gtkui.py
+++ b/deluge/ui/gtk3/gtkui.py
@@ -15,8 +15,8 @@ import time
import gi # isort:skip (Required before Gtk import).
-gi.require_version('Gtk', '3.0') # NOQA: E402
-gi.require_version('Gdk', '3.0') # NOQA: E402
+gi.require_version('Gtk', '3.0')
+gi.require_version('Gdk', '3.0')
# isort:imports-thirdparty
from gi.repository.GLib import set_prgname
diff --git a/deluge/ui/gtk3/listview.py b/deluge/ui/gtk3/listview.py
index f262e0ba3..e9f6b1084 100644
--- a/deluge/ui/gtk3/listview.py
+++ b/deluge/ui/gtk3/listview.py
@@ -76,7 +76,7 @@ class ListView:
}
def __init__(self, title=None, cell_renderer=None, **args):
- """ Constructor, see Gtk.TreeViewColumn """
+ """Constructor, see Gtk.TreeViewColumn"""
Gtk.TreeViewColumn.__init__(self, title, cell_renderer, **args)
label = Gtk.Label(label=title)
self.set_widget(label)
diff --git a/deluge/ui/gtk3/path_combo_chooser.py b/deluge/ui/gtk3/path_combo_chooser.py
index 0eb13b2c3..74d9055b7 100755
--- a/deluge/ui/gtk3/path_combo_chooser.py
+++ b/deluge/ui/gtk3/path_combo_chooser.py
@@ -1405,7 +1405,7 @@ class PathChooserComboBox(Gtk.Box, StoredValuesPopup, GObject.GObject):
self.set_text(self.get_text())
def _on_entry_combobox_hbox_realize(self, widget):
- """ Must do this when the widget is realized """
+ """Must do this when the widget is realized"""
self.set_filechooser_button_visible(self.filechooser_visible)
self.set_path_entry_visible(self.path_entry_visible)
diff --git a/deluge/ui/gtk3/piecesbar.py b/deluge/ui/gtk3/piecesbar.py
index 368d598bc..8665328c0 100644
--- a/deluge/ui/gtk3/piecesbar.py
+++ b/deluge/ui/gtk3/piecesbar.py
@@ -10,9 +10,9 @@ from math import pi
import gi # isort:skip (Version check required before import).
-gi.require_version('PangoCairo', '1.0') # NOQA: E402
-gi.require_foreign('cairo') # NOQA: E402
-gi.require_version('cairo', '1.0') # NOQA: E402
+gi.require_version('PangoCairo', '1.0')
+gi.require_foreign('cairo')
+gi.require_version('cairo', '1.0')
# isort:imports-thirdparty
import cairo # Backward compat cairo <= 1.15
diff --git a/deluge/ui/gtk3/preferences.py b/deluge/ui/gtk3/preferences.py
index 4c09f91e4..a008a9562 100644
--- a/deluge/ui/gtk3/preferences.py
+++ b/deluge/ui/gtk3/preferences.py
@@ -19,6 +19,7 @@ from gi.repository.Gdk import Color
import deluge.common
import deluge.component as component
from deluge.configmanager import ConfigManager, get_config_dir
+from deluge.decorators import maybe_coroutine
from deluge.error import AuthManagerError, NotAuthorizedError
from deluge.i18n import get_languages
from deluge.ui.client import client
@@ -1337,8 +1338,6 @@ class Preferences(component.Component):
self.builder.get_object('accounts_edit').set_sensitive(False)
self.builder.get_object('accounts_delete').set_sensitive(False)
- from deluge.decorators import maybe_coroutine
-
@maybe_coroutine
async def on_accounts_add_clicked(self, widget):
dialog = AccountDialog(
diff --git a/deluge/ui/web/js/deluge-all/AboutWindow.js b/deluge/ui/web/js/deluge-all/AboutWindow.js
index 15fede9b8..cfae7a862 100644
--- a/deluge/ui/web/js/deluge-all/AboutWindow.js
+++ b/deluge/ui/web/js/deluge-all/AboutWindow.js
@@ -104,8 +104,7 @@ Deluge.about.AboutWindow = Ext.extend(Ext.Window, {
{
xtype: 'label',
style: 'padding-top: 5px; font-size: 12px;',
- html:
- '<a href="https://deluge-torrent.org" target="_blank">deluge-torrent.org</a>',
+ html: '<a href="https://deluge-torrent.org" target="_blank">deluge-torrent.org</a>',
},
]);
this.addButton(_('Close'), this.onCloseClick, this);
diff --git a/deluge/ui/web/js/deluge-all/AddTrackerWindow.js b/deluge/ui/web/js/deluge-all/AddTrackerWindow.js
index 8fbe0b221..aaf4a3ff9 100644
--- a/deluge/ui/web/js/deluge-all/AddTrackerWindow.js
+++ b/deluge/ui/web/js/deluge-all/AddTrackerWindow.js
@@ -10,7 +10,8 @@
Ext.ns('Deluge');
// Custom VType validator for tracker urls
-var trackerUrlTest = /(((^https?)|(^udp)):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\\/+@&#;`~=%!]*)(\.\w{2,})?)*\/?)/i;
+var trackerUrlTest =
+ /(((^https?)|(^udp)):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\\/+@&#;`~=%!]*)(\.\w{2,})?)*\/?)/i;
Ext.apply(Ext.form.VTypes, {
trackerUrl: function (val, field) {
return trackerUrlTest.test(val);
diff --git a/deluge/ui/web/js/deluge-all/add/OptionsPanel.js b/deluge/ui/web/js/deluge-all/add/OptionsPanel.js
index 6b75686a3..365b00190 100644
--- a/deluge/ui/web/js/deluge-all/add/OptionsPanel.js
+++ b/deluge/ui/web/js/deluge-all/add/OptionsPanel.js
@@ -134,9 +134,8 @@ Deluge.add.OptionsPanel = Ext.extend(Ext.TabPanel, {
nodes,
function (node) {
if (node.attributes.fileindex < 0) return;
- var priorities = this.form.optionsManager.get(
- 'file_priorities'
- );
+ var priorities =
+ this.form.optionsManager.get('file_priorities');
priorities[node.attributes.fileindex] = newValue;
this.form.optionsManager.update('file_priorities', priorities);
},
diff --git a/deluge/ui/web/js/deluge-all/preferences/BandwidthPage.js b/deluge/ui/web/js/deluge-all/preferences/BandwidthPage.js
index 4c3720198..8c32da501 100644
--- a/deluge/ui/web/js/deluge-all/preferences/BandwidthPage.js
+++ b/deluge/ui/web/js/deluge-all/preferences/BandwidthPage.js
@@ -117,8 +117,7 @@ Deluge.preferences.Bandwidth = Ext.extend(Ext.form.FormPanel, {
border: false,
title: '',
defaultType: 'checkbox',
- style:
- 'padding-top: 0px; padding-bottom: 5px; margin-top: 0px; margin-bottom: 0px;',
+ style: 'padding-top: 0px; padding-bottom: 5px; margin-top: 0px; margin-bottom: 0px;',
autoHeight: true,
});
om.bind(
diff --git a/deluge/ui/web/js/extjs/ext-extensions/form/SpinnerGroup.js b/deluge/ui/web/js/extjs/ext-extensions/form/SpinnerGroup.js
index 31eca735c..ee761aa6f 100644
--- a/deluge/ui/web/js/extjs/ext-extensions/form/SpinnerGroup.js
+++ b/deluge/ui/web/js/extjs/ext-extensions/form/SpinnerGroup.js
@@ -80,9 +80,8 @@ Ext.ux.form.SpinnerGroup = Ext.extend(Ext.form.CheckboxGroup, {
// Generate the column configs with the correct width setting
for (var i = 0; i < numCols; i++) {
var cc = Ext.apply({ items: [] }, colCfg);
- cc[
- this.columns[i] <= 1 ? 'columnWidth' : 'width'
- ] = this.columns[i];
+ cc[this.columns[i] <= 1 ? 'columnWidth' : 'width'] =
+ this.columns[i];
if (this.defaults) {
cc.defaults = Ext.apply(
cc.defaults || {},