🛠️ myice/myice.py -> updated function get_login by simplifying config reading; renamed functions open, get_game_pdf, get_practice_pdf to os_open, get_game_pdf_os, get_practice_pdf_os respectively

🔴 pyproject.toml -> removed version 'v0.1.2', now at 'v0.1.3'
This commit is contained in:
2024-11-01 11:17:26 +01:00
parent c93c9fadd9
commit bce52d2462
2 changed files with 10 additions and 12 deletions
+9 -11
View File
@@ -52,14 +52,12 @@ def save_cookies():
def get_login(local_file: str = "myice.ini") -> tuple[str, str, int]: def get_login(local_file: str = "myice.ini") -> tuple[str, str, int]:
config = configparser.ConfigParser() config = configparser.ConfigParser()
print( config.read(
config.read( [
[ Path("~/.config/myice.ini").expanduser(),
Path("~/.config/myice.ini").expanduser(), "myice.ini",
"myice.ini", local_file,
local_file, ]
]
)
) )
if "default" in config.sections(): if "default" in config.sections():
default_config = config["default"] default_config = config["default"]
@@ -218,7 +216,7 @@ def schedule(
print(schedule) print(schedule)
def open(file: str) -> None: def os_open(file: str) -> None:
if os.uname().sysname == "Linux": if os.uname().sysname == "Linux":
os.system(f"xdg-open {file}") os.system(f"xdg-open {file}")
else: else:
@@ -235,7 +233,7 @@ def get_game_pdf(
""" """
output_filename = f"game_{game_id}.pdf" output_filename = f"game_{game_id}.pdf"
game_pdf(game_id, Path(output_filename)) game_pdf(game_id, Path(output_filename))
open(output_filename) os_open(output_filename)
@app.command("practice") @app.command("practice")
@@ -247,7 +245,7 @@ def get_practice_pdf(
""" """
output_filename = f"practice_{game_id}.pdf" output_filename = f"practice_{game_id}.pdf"
practice_pdf(game_id, Path(output_filename)) practice_pdf(game_id, Path(output_filename))
open(output_filename) os_open(output_filename)
@app.command("search") @app.command("search")
+1 -1
View File
@@ -1,6 +1,6 @@
[tool.poetry] [tool.poetry]
name = "myice" name = "myice"
version = "v0.1.1" version = "v0.1.3"
description = "myice parsing" description = "myice parsing"
authors = ["Rene Luria <rene@luria.ch>"] authors = ["Rene Luria <rene@luria.ch>"]
license = "MIT" license = "MIT"