From d2b2284bd45f1ec2cb3a06d7ad7bc25c2ac6824b Mon Sep 17 00:00:00 2001 From: woni <320753691@qq.com> Date: Wed, 9 Apr 2025 20:52:22 +0800 Subject: [PATCH] first commit --- src/ziniao.py | 37 +++++++++++++++++++++++++++++++++++++ tests/test_ziniao.py | 1 + 2 files changed, 38 insertions(+) create mode 100644 src/ziniao.py create mode 100644 tests/test_ziniao.py diff --git a/src/ziniao.py b/src/ziniao.py new file mode 100644 index 0000000..058c2d2 --- /dev/null +++ b/src/ziniao.py @@ -0,0 +1,37 @@ +import winreg + +class Ziniao: + def __init__(self, name): + pass + + def login(self, username, password): + pass + + def open_store(self): + pass + + def close_store(self): + pass + + def close(self): + pass + + def get_ziniao_exe_path(self): + """ + Returns: + str: The DisplayIcon value if found, None otherwise + """ + try: + # Open the registry key + reg_path = r"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\8c327052-d9e8-5248-931f-e5b8c47f82b5" + key = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, reg_path) + + # Query the DisplayIcon value + display_icon, _ = winreg.QueryValueEx(key, "DisplayIcon") + winreg.CloseKey(key) + + return display_icon + except FileNotFoundError: + return "Registry key not found" + except WindowsError as e: + return f"Error accessing registry: {e}" diff --git a/tests/test_ziniao.py b/tests/test_ziniao.py new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/tests/test_ziniao.py @@ -0,0 +1 @@ +