diff --git a/hu.kramo.Cartridges.json b/hu.kramo.Cartridges.json index df06295..51185ab 100644 --- a/hu.kramo.Cartridges.json +++ b/hu.kramo.Cartridges.json @@ -10,7 +10,6 @@ "--device=dri", "--socket=wayland", "--talk-name=org.freedesktop.Flatpak", - "--filesystem=xdg-run/gvfsd", "--filesystem=~/.steam/steam/", "--filesystem=~/.var/app/com.heroicgameslauncher.hgl/config/heroic/" ], diff --git a/src/utils/create_details_window.py b/src/utils/create_details_window.py index 6605c78..1d07e8c 100644 --- a/src/utils/create_details_window.py +++ b/src/utils/create_details_window.py @@ -18,7 +18,7 @@ # SPDX-License-Identifier: GPL-3.0-or-later def create_details_window(parent_widget, game_id = None): - import os, json, time + import time from gi.repository import Adw, Gtk, Gio, GLib, GdkPixbuf from .create_dialog import create_dialog from .save_games import save_games diff --git a/src/utils/heroic_parser.py b/src/utils/heroic_parser.py index 8a87441..73e6e62 100644 --- a/src/utils/heroic_parser.py +++ b/src/utils/heroic_parser.py @@ -49,7 +49,7 @@ def heroic_parser(parent_widget, action): create_dialog(parent_widget, _("Couldn't Import Games"), _("Heroic directory cannot be found."), "choose_folder", _("Set Heroic Location")).connect("response", response) - if os.path.exists(os.path.join(heroic_dir, "config.json")) == True: + if os.path.exists(os.path.join(heroic_dir, "config.json")): pass else: heroic_not_found() @@ -141,9 +141,9 @@ def heroic_parser(parent_widget, action): heroic_games[values["game_id"]] = values # Import sideloaded games - if schema.get_boolean("heroic-import-sideload") == False: + if not schema.get_boolean("heroic-import-sideload"): pass - elif os.path.exists(os.path.join(heroic_dir, "sideload_apps", "library.json")) == True: + elif os.path.exists(os.path.join(heroic_dir, "sideload_apps", "library.json")): open_file = open(os.path.join(heroic_dir, "sideload_apps", "library.json"), "r") data = open_file.read() open_file.close() diff --git a/src/utils/run_command.py b/src/utils/run_command.py index 0670514..d06cb7e 100644 --- a/src/utils/run_command.py +++ b/src/utils/run_command.py @@ -24,5 +24,5 @@ def run_command(parent_widget, executable): subprocess.Popen(["flatpak-spawn --host " + executable], shell=True, start_new_session=True) - if Gio.Settings.new("hu.kramo.Cartridges").get_boolean("exit-after-launch") == True: + if Gio.Settings.new("hu.kramo.Cartridges").get_boolean("exit-after-launch"): sys.exit() diff --git a/src/utils/steam_parser.py b/src/utils/steam_parser.py index 6815d63..e59f3ad 100644 --- a/src/utils/steam_parser.py +++ b/src/utils/steam_parser.py @@ -48,11 +48,11 @@ def steam_parser(parent_widget, action): create_dialog(parent_widget, _("Couldn't Import Games"), _("Steam directory cannot be found."), "choose_folder", _("Set Steam Location")).connect("response", response) - if os.path.exists(os.path.join(steam_dir, "steamapps")) == True: + if os.path.exists(os.path.join(steam_dir, "steamapps")): pass - elif os.path.exists(os.path.join(steam_dir, "steam", "steamapps")) == True: + elif os.path.exists(os.path.join(steam_dir, "steam", "steamapps")): schema.set_string("steam-location", os.path.join(steam_dir, "steam")) - elif os.path.exists(os.path.join(steam_dir, "Steam", "steamapps")) == True: + elif os.path.exists(os.path.join(steam_dir, "Steam", "steamapps")): schema.set_string("steam-location", os.path.join(steam_dir, "Steam")) else: steam_not_found() @@ -90,7 +90,7 @@ def steam_parser(parent_widget, action): values["added"] = current_time values["last_played"] = 0 - if os.path.isfile(os.path.join(steam_dir, "appcache", "librarycache", values["appid"] + "_library_600x900.jpg")) == True: + if os.path.isfile(os.path.join(steam_dir, "appcache", "librarycache", values["appid"] + "_library_600x900.jpg")): values["pixbuf_options"] = save_cover(values, parent_widget, os.path.join(steam_dir, "appcache", "librarycache", values["appid"] + "_library_600x900.jpg")) steam_games[values["game_id"]] = values diff --git a/src/utils/toggle_hidden.py b/src/utils/toggle_hidden.py index 4094da0..119b4ad 100644 --- a/src/utils/toggle_hidden.py +++ b/src/utils/toggle_hidden.py @@ -21,7 +21,7 @@ def toggle_hidden(game): import os, json games_dir = os.path.join(os.environ.get("XDG_DATA_HOME"), "cartridges", "games") - if os.path.exists(games_dir) == False: + if not os.path.exists(games_dir): return file = open(os.path.join(games_dir, game + ".json"), "r") diff --git a/src/window.py b/src/window.py index 15fc8d7..88ebb5b 100644 --- a/src/window.py +++ b/src/window.py @@ -118,7 +118,7 @@ class CartridgesWindow(Adw.ApplicationWindow): entry = game(current_game["name"], get_cover(current_game, self), game_id) - if self.games[game_id]["hidden"] == False: + if not self.games[game_id]["hidden"]: self.visible_widgets[game_id] = entry self.library.append(entry) else: @@ -144,7 +144,7 @@ class CartridgesWindow(Adw.ApplicationWindow): def search_changed(self, widget, hidden): # Refresh search filter on keystroke in search box - if hidden == False: + if not hidden: self.library.invalidate_filter() else: self.hidden_library.invalidate_filter() @@ -203,7 +203,7 @@ class CartridgesWindow(Adw.ApplicationWindow): def show_overview(self, widget, game_id): game = self.games[game_id] - if game["hidden"] == False: + if not game["hidden"]: self.overview_menu_button.set_menu_model(self.game_options) else: self.overview_menu_button.set_menu_model(self.hidden_game_options) @@ -341,7 +341,7 @@ class CartridgesWindow(Adw.ApplicationWindow): search_bar.set_search_mode(not search_mode) search_button.set_active(not search_button.get_active()) - if search_mode == False: + if not search_mode: self.set_focus(search_entry) else: search_entry.set_text("")