diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7ad1662..4e40fe9 100755 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -35,6 +35,11 @@ repos: rev: v3.9.0 hooks: - id: reorder-python-imports + - repo: https://github.com/asottile/pyupgrade + rev: v3.2.0 + hooks: + - id: pyupgrade + args: [--py3-plus] - repo: https://github.com/psf/black rev: 22.10.0 hooks: diff --git a/modules/util.py b/modules/util.py index 9d8b0e7..6b6a4b1 100755 --- a/modules/util.py +++ b/modules/util.py @@ -191,7 +191,7 @@ class Failed(Exception): def list_in_text(text, search_list, match_all=False): if isinstance(search_list, list): search_list = set(search_list) - contains = set([x for x in search_list if " " in x]) + contains = {x for x in search_list if " " in x} exception = search_list - contains if match_all: if all(x == m for m in text.split(" ") for x in exception) or all(x in text for x in contains): @@ -278,7 +278,7 @@ def nohardlink(file): # Load json file if exists def load_json(file): if os.path.isfile(file): - f = open(file, "r") + f = open(file) data = json.load(f) f.close() else: diff --git a/qbit_manage.py b/qbit_manage.py index 9af93b9..14d7641 100755 --- a/qbit_manage.py +++ b/qbit_manage.py @@ -496,9 +496,9 @@ if __name__ == "__main__": logger.info_center(" _ _ _ ") # noqa: W605 logger.info_center(" | | (_) | ") # noqa: W605 logger.info_center(" __ _| |__ _| |_ _ __ ___ __ _ _ __ __ _ __ _ ___ ") # noqa: W605 - logger.info_center(" / _` | '_ \| | __| | '_ ` _ \ / _` | '_ \ / _` |/ _` |/ _ \\") # noqa: W605 + logger.info_center(" / _` | '_ \\| | __| | '_ ` _ \\ / _` | '_ \\ / _` |/ _` |/ _ \\") # noqa: W605 logger.info_center(" | (_| | |_) | | |_ | | | | | | (_| | | | | (_| | (_| | __/") # noqa: W605 - logger.info_center(" \__, |_.__/|_|\__| |_| |_| |_|\__,_|_| |_|\__,_|\__, |\___|") # noqa: W605 + logger.info_center(r" \__, |_.__/|_|\__| |_| |_| |_|\__,_|_| |_|\__,_|\__, |\___|") # noqa: W605 logger.info_center(" | | ______ __/ | ") # noqa: W605 logger.info_center(" |_| |______| |___/ ") # noqa: W605 logger.info(f" Version: {version}")