🛠️ 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:
@@ -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")
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[tool.poetry]
|
||||
name = "myice"
|
||||
version = "v0.1.1"
|
||||
version = "v0.1.3"
|
||||
description = "myice parsing"
|
||||
authors = ["Rene Luria <rene@luria.ch>"]
|
||||
license = "MIT"
|
||||
|
||||
Reference in New Issue
Block a user