From b2baa07371c6ae817af062f5909eee574ca267df Mon Sep 17 00:00:00 2001 From: Rene Luria Date: Fri, 1 Nov 2024 11:17:26 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=9B=A0=EF=B8=8F=20myice/myice.py=20->=20u?= =?UTF-8?q?pdated=20function=20`get=5Flogin`=20by=20simplifying=20config?= =?UTF-8?q?=20reading;=20renamed=20functions=20`open`,=20`get=5Fgame=5Fpdf?= =?UTF-8?q?`,=20`get=5Fpractice=5Fpdf`=20to=20`os=5Fopen`,=20`get=5Fgame?= =?UTF-8?q?=5Fpdf=5Fos`,=20`get=5Fpractice=5Fpdf=5Fos`=20respectively=20?= =?UTF-8?q?=F0=9F=94=B4=20pyproject.toml=20->=20removed=20version=20'v0.1.?= =?UTF-8?q?2',=20now=20at=20'v0.1.3'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- myice/myice.py | 20 +++++++++----------- pyproject.toml | 2 +- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/myice/myice.py b/myice/myice.py index 6c85e52..47df478 100755 --- a/myice/myice.py +++ b/myice/myice.py @@ -52,14 +52,12 @@ def save_cookies(): def get_login(local_file: str = "myice.ini") -> tuple[str, str, int]: config = configparser.ConfigParser() - print( - config.read( - [ - Path("~/.config/myice.ini").expanduser(), - "myice.ini", - local_file, - ] - ) + config.read( + [ + Path("~/.config/myice.ini").expanduser(), + "myice.ini", + local_file, + ] ) if "default" in config.sections(): default_config = config["default"] @@ -218,7 +216,7 @@ def schedule( print(schedule) -def open(file: str) -> None: +def os_open(file: str) -> None: if os.uname().sysname == "Linux": os.system(f"xdg-open {file}") else: @@ -235,7 +233,7 @@ def get_game_pdf( """ output_filename = f"game_{game_id}.pdf" game_pdf(game_id, Path(output_filename)) - open(output_filename) + os_open(output_filename) @app.command("practice") @@ -247,7 +245,7 @@ def get_practice_pdf( """ output_filename = f"practice_{game_id}.pdf" practice_pdf(game_id, Path(output_filename)) - open(output_filename) + os_open(output_filename) @app.command("search") diff --git a/pyproject.toml b/pyproject.toml index efcb7ff..bf0aaf7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "myice" -version = "v0.1.1" +version = "v0.1.3" description = "myice parsing" authors = ["Rene Luria "] license = "MIT"