summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcopilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>2026-02-11 10:03:59 +0000
committercopilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>2026-02-11 10:03:59 +0000
commitacfb1c85e1f2750b1e5d07f078c6e03b4408c766 (patch)
tree83a1e23f1da06a9066dde26b6c68ed70ca35ab6b
parentdc65b3591a6a6fbec3f3b6af875c0907ab782047 (diff)
downloadaccelerator-installer-acfb1c85e1f2750b1e5d07f078c6e03b4408c766.tar.gz
accelerator-installer-acfb1c85e1f2750b1e5d07f078c6e03b4408c766.zip
Refactor: Extract store type names to constant for better maintainability
Co-authored-by: tranch <5999732+tranch@users.noreply.github.com>
-rw-r--r--__pycache__/mock_decky_server.cpython-312.pycbin0 -> 29089 bytes
-rw-r--r--decky_client.py9
2 files changed, 8 insertions, 1 deletions
diff --git a/__pycache__/mock_decky_server.cpython-312.pyc b/__pycache__/mock_decky_server.cpython-312.pyc
new file mode 100644
index 0000000..5f59a82
--- /dev/null
+++ b/__pycache__/mock_decky_server.cpython-312.pyc
Binary files differ
diff --git a/decky_client.py b/decky_client.py
index 5fda567..38726ce 100644
--- a/decky_client.py
+++ b/decky_client.py
@@ -17,6 +17,13 @@ EVENT = 3
# Default store URL
DEFAULT_STORE_URL = "https://plugins.deckbrew.xyz/plugins"
+# Store type mapping
+STORE_TYPE_NAMES = {
+ 0: "default",
+ 1: "testing",
+ 2: "custom"
+}
+
def log(*args: Any) -> None:
"""Print formatted logs to stderr."""
@@ -351,7 +358,7 @@ async def get_store_url() -> str:
if msg.get("type") == REPLY:
store_type = msg.get('result')
- store_type_name = {0: "default", 1: "testing", 2: "custom"}.get(store_type, f"unknown ({store_type})")
+ store_type_name = STORE_TYPE_NAMES.get(store_type, f"unknown ({store_type})")
log(f"Current store type: {store_type_name}")
elif msg.get("type") == ERROR:
log(f"Server error: {msg.get('error')}")