From a57113eb115818169cec4402020520dd8a01035d Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Wed, 7 Sep 2022 16:00:33 +0000 Subject: [PATCH 1/2] Remove unused imports --- src/builtin_preset_row.py | 4 +--- src/explore_preset_row.py | 3 +-- src/main.py | 5 ----- src/plugin_row.py | 3 +-- src/plugins_list.py | 9 +-------- src/preferences.py | 5 ++--- src/preset_row.py | 2 +- src/presets_manager_window.py | 6 ++---- src/repo_row.py | 5 ++--- src/run_async.py | 1 - src/welcome.py | 5 ++--- src/window.py | 5 +---- 12 files changed, 14 insertions(+), 39 deletions(-) diff --git a/src/builtin_preset_row.py b/src/builtin_preset_row.py index b14568b6..fdee0aaf 100644 --- a/src/builtin_preset_row.py +++ b/src/builtin_preset_row.py @@ -1,9 +1,7 @@ -from gi.repository import Gtk, Gdk, Adw +from gi.repository import Gtk, Adw from .constants import rootdir from .modules.utils import to_slug_case, buglog -import json -import os @Gtk.Template(resource_path=f"{rootdir}/ui/builtin_preset_row.ui") diff --git a/src/explore_preset_row.py b/src/explore_preset_row.py index ec6cd2bb..6390ba66 100644 --- a/src/explore_preset_row.py +++ b/src/explore_preset_row.py @@ -16,10 +16,9 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -import json import os -from gi.repository import Gtk, Gdk, Adw +from gi.repository import Gtk, Adw from .constants import rootdir from .modules.custom_presets import download_preset diff --git a/src/main.py b/src/main.py index 5f622715..fa9ee057 100644 --- a/src/main.py +++ b/src/main.py @@ -19,16 +19,11 @@ import sys import json import os -import traceback - -import gi from gi.repository import Gtk, Gdk, Gio, Adw, GLib, Xdp, XdpGtk4 from material_color_utilities_python import * from .settings_schema import settings_schema from .window import GradienceMainWindow -from .palette_shades import GradiencePaletteShades -from .option import GradienceOption from .app_type_dialog import GradienceAppTypeDialog from .custom_css_group import GradienceCustomCSSGroup from .constants import ( diff --git a/src/plugin_row.py b/src/plugin_row.py index 7217ac2e..c00a0f03 100644 --- a/src/plugin_row.py +++ b/src/plugin_row.py @@ -16,11 +16,10 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -from gi.repository import Gtk, Gdk, Adw +from gi.repository import Gtk, Adw from .modules.utils import buglog from .constants import rootdir -import os @Gtk.Template(resource_path=f"{rootdir}/ui/plugin_row.ui") diff --git a/src/plugins_list.py b/src/plugins_list.py index 263a406b..3ed85de5 100644 --- a/src/plugins_list.py +++ b/src/plugins_list.py @@ -16,18 +16,11 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -import sys import os -import importlib -import pkgutil -from gi.repository import Gtk, Adw, Gio, Gdk +from gi.repository import Adw from yapsy.PluginManager import PluginManager - -from pathlib import Path -from .modules.utils import buglog from .plugin_row import GradiencePluginRow -from .constants import app_id class GradiencePluginsList: diff --git a/src/preferences.py b/src/preferences.py index eefd5cba..0c185f6d 100644 --- a/src/preferences.py +++ b/src/preferences.py @@ -16,11 +16,10 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -import os -from gi.repository import GLib, Gio, Gtk, Adw +from gi.repository import Gtk, Adw -from .constants import rootdir, app_id +from .constants import rootdir from .modules.flatpak_overrides import ( create_gtk_user_override, remove_gtk_user_override, diff --git a/src/preset_row.py b/src/preset_row.py index 0a8fc318..5330e02e 100644 --- a/src/preset_row.py +++ b/src/preset_row.py @@ -19,7 +19,7 @@ import json import os -from gi.repository import Gtk, Gdk, Adw +from gi.repository import Gtk, Adw from .constants import rootdir from .modules.utils import to_slug_case, buglog diff --git a/src/presets_manager_window.py b/src/presets_manager_window.py index 74478edf..3fa71c23 100644 --- a/src/presets_manager_window.py +++ b/src/presets_manager_window.py @@ -16,20 +16,18 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -from genericpath import isdir import os import shutil import json from pathlib import Path -from gi.repository import Gtk, Adw, Gio, Gdk, GLib +from gi.repository import Gtk, Adw, GLib from .preset_row import GradiencePresetRow from .builtin_preset_row import GradienceBuiltinPresetRow from .explore_preset_row import GradienceExplorePresetRow from .modules.custom_presets import fetch_presets -from .constants import rootdir, build_type -from .modules.utils import to_slug_case +from .constants import rootdir from .repo_row import GradienceRepoRow PRESETS_LIST_URL = "https://github.com/GradienceTeam/Community/raw/main/presets.json" diff --git a/src/repo_row.py b/src/repo_row.py index 4c735ec1..d347e22c 100644 --- a/src/repo_row.py +++ b/src/repo_row.py @@ -16,13 +16,12 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -import json import os -from gi.repository import Gtk, Gdk, Adw +from gi.repository import Gtk, Adw from .constants import rootdir -from .modules.utils import to_slug_case, buglog +from .modules.utils import to_slug_case @Gtk.Template(resource_path=f"{rootdir}/ui/repo_row.ui") diff --git a/src/run_async.py b/src/run_async.py index 1feff72a..336e042b 100644 --- a/src/run_async.py +++ b/src/run_async.py @@ -17,7 +17,6 @@ # along with this program. If not, see . -import os import sys import threading import traceback diff --git a/src/welcome.py b/src/welcome.py index 4682e540..120f8d6f 100644 --- a/src/welcome.py +++ b/src/welcome.py @@ -19,14 +19,13 @@ import sys import time -from gi.repository import Gtk, Adw, Gio, Gdk +from gi.repository import Gtk, Adw, Gio from .run_async import RunAsync from .modules.utils import buglog from .modules.flatpak_overrides import ( create_gtk_user_override, - remove_gtk_user_override, -) + ) from .constants import rootdir, app_id diff --git a/src/window.py b/src/window.py index ad68d81f..ba84357e 100644 --- a/src/window.py +++ b/src/window.py @@ -19,7 +19,7 @@ import os -from gi.repository import Gtk, Adw, Gio, Gdk +from gi.repository import Gtk, Adw, Gio from svglib.svglib import svg2rlg from reportlab.graphics import renderPM @@ -29,10 +29,7 @@ from .error import GradienceError from .settings_schema import settings_schema from .palette_shades import GradiencePaletteShades from .option import GradienceOption -from .app_type_dialog import GradienceAppTypeDialog -from .custom_css_group import GradienceCustomCSSGroup from .presets_manager_window import GradiencePresetWindow -from .plugins_list import GradiencePluginsList from .modules.utils import buglog from .constants import rootdir, app_id, build_type From 36a52d8f0be5399192e4626c84ba39cd10f23cba Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Wed, 7 Sep 2022 16:00:50 +0000 Subject: [PATCH 2/2] Format code with black and autopep8 --- src/welcome.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/welcome.py b/src/welcome.py index 120f8d6f..1a840262 100644 --- a/src/welcome.py +++ b/src/welcome.py @@ -25,7 +25,7 @@ from .run_async import RunAsync from .modules.utils import buglog from .modules.flatpak_overrides import ( create_gtk_user_override, - ) +) from .constants import rootdir, app_id