1
0
mirror of https://github.com/lutris/lutris synced 2024-07-01 06:34:26 +00:00

Formatting

This commit is contained in:
Mathieu Comandon 2024-04-12 00:20:52 -07:00
parent da0a17d279
commit 859967ecbf
3 changed files with 7 additions and 17 deletions

View File

@ -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())

View File

@ -1,4 +1,4 @@
from gettext import gettext as _
from gettext import gettext as _
from gi.repository import Gtk

View File

@ -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 _