From 859967ecbf438456c4d7db94909121e98ad3b618 Mon Sep 17 00:00:00 2001 From: Mathieu Comandon Date: Fri, 12 Apr 2024 00:20:52 -0700 Subject: [PATCH] Formatting --- lutris/database/categories.py | 20 +++++--------------- lutris/gui/config/preferences_box.py | 2 +- lutris/installer/interpreter.py | 2 +- 3 files changed, 7 insertions(+), 17 deletions(-) diff --git a/lutris/database/categories.py b/lutris/database/categories.py index 73b862070..c7a0b68fc 100644 --- a/lutris/database/categories.py +++ b/lutris/database/categories.py @@ -2,7 +2,7 @@ import abc import re from collections import defaultdict from itertools import repeat -from typing import List, Dict, Union +from typing import Dict, List, Union from lutris import settings from lutris.database import sql @@ -42,9 +42,7 @@ _SMART_CATEGORIES: List[_SmartCategory] = [_SmartUncategorizedCategory()] # Convenient method to iterate category with id. # Note that ids that are positive integers should not be used, as they can conflict with existing categories. -_SMART_CATEGORIES_WITH_ID = [ - (category, f"smart-category-{id}") for id, category in enumerate(_SMART_CATEGORIES) -] +_SMART_CATEGORIES_WITH_ID = [(category, f"smart-category-{id}") for id, category in enumerate(_SMART_CATEGORIES)] def strip_category_name(name): @@ -119,19 +117,11 @@ def get_game_ids_for_categories(included_category_names=None, excluded_category_ if filters: query += " WHERE %s" % " AND ".join(filters) - result = set( - game["id"] for game in sql.db_query(settings.DB_PATH, query, tuple(parameters)) - ) + result = set(game["id"] for game in sql.db_query(settings.DB_PATH, query, tuple(parameters))) for smart_cat in _SMART_CATEGORIES: - if ( - excluded_category_names is not None - and smart_cat.get_name() in excluded_category_names - ): + if excluded_category_names is not None and smart_cat.get_name() in excluded_category_names: continue - if ( - included_category_names is not None - and smart_cat.get_name() not in included_category_names - ): + if included_category_names is not None and smart_cat.get_name() not in included_category_names: continue result |= set(smart_cat.get_games()) diff --git a/lutris/gui/config/preferences_box.py b/lutris/gui/config/preferences_box.py index 3d6f2eb25..fcd57ff0e 100644 --- a/lutris/gui/config/preferences_box.py +++ b/lutris/gui/config/preferences_box.py @@ -1,4 +1,4 @@ -from gettext import gettext as _ +from gettext import gettext as _ from gi.repository import Gtk diff --git a/lutris/installer/interpreter.py b/lutris/installer/interpreter.py index 6c2566818..fbf523503 100644 --- a/lutris/installer/interpreter.py +++ b/lutris/installer/interpreter.py @@ -1,4 +1,4 @@ -"""Install a game by following its install script.""" +"""Install a game by following its install script.""" import os from gettext import gettext as _