From 49f72ef22e993dd7e947b04cc4665252cc83c0bb Mon Sep 17 00:00:00 2001 From: Rene Luria Date: Fri, 1 Nov 2024 11:23:05 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=9B=A0=EF=B8=8F=20myice.py=20->=20updated?= =?UTF-8?q?=20error=20messages=20to=20redirect=20to=20stderr=20?= =?UTF-8?q?=F0=9F=9B=A0=EF=B8=8F=20myice.py=20->=20changed=20login=20and?= =?UTF-8?q?=20get\=5Fuserid=20prints=20to=20write=20to=20stderr=20?= =?UTF-8?q?=F0=9F=94=B4=20pyproject.toml=20->=20removed=20version=20v0.1.3?= =?UTF-8?q?=20=F0=9F=9F=A2=20pyproject.toml=20->=20added=20version=20v0.1.?= =?UTF-8?q?5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- myice/myice.py | 11 ++++++----- pyproject.toml | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/myice/myice.py b/myice/myice.py index 47df478..040c3b5 100755 --- a/myice/myice.py +++ b/myice/myice.py @@ -66,10 +66,12 @@ def get_login(local_file: str = "myice.ini") -> tuple[str, str, int]: password = default_config.get("password") userid = default_config.getint("userid") if not username or not password: - print("Error: please configure username/password in ini file") + print( + "Error: please configure username/password in ini file", file=sys.stderr + ) sys.exit(1) else: - print("Error: please configure username/password in ini file") + print("Error: please configure username/password in ini file", file=sys.stderr) sys.exit(1) return username, password, userid @@ -123,12 +125,12 @@ def wrapper_session(func): session.cookies = load_cookies() session.cookies.clear_expired_cookies() if not session.cookies.get("mih_v3_cookname"): - print("login...") + print("login...", file=sys.stderr) do_login() save_cookies() _, _, userid = get_login() if not userid: - print("get userid...") + print("get userid...", file=sys.stderr) userid = get_userid() return func(*args, **kwargs) @@ -212,7 +214,6 @@ def schedule( with outfile.open("w") as f: f.write(schedule) else: - print("Schedule:", file=sys.stderr) print(schedule) diff --git a/pyproject.toml b/pyproject.toml index bf0aaf7..b8357e1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "myice" -version = "v0.1.3" +version = "v0.1.5" description = "myice parsing" authors = ["Rene Luria "] license = "MIT"