aboutsummaryrefslogtreecommitdiff
path: root/src/splitscreen_duo/__init__.py
diff options
context:
space:
mode:
authorZoltan Szabatin <[email protected]>2025-03-02 17:32:55 -0800
committerZoltan Szabatin <[email protected]>2025-03-02 17:33:19 -0800
commite32619cfdf5103625e91a67b3b5e175cef43f662 (patch)
treee254698693f96fa7861399ce6ab32b7ea1391abd /src/splitscreen_duo/__init__.py
parentstyle(src): Format files (diff)
downloadsplitscreen-duo-e32619cfdf5103625e91a67b3b5e175cef43f662.tar.xz
splitscreen-duo-e32619cfdf5103625e91a67b3b5e175cef43f662.zip
refactor: Move serial and Pygame definitions up in hierarchy
Diffstat (limited to 'src/splitscreen_duo/__init__.py')
-rw-r--r--src/splitscreen_duo/__init__.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/splitscreen_duo/__init__.py b/src/splitscreen_duo/__init__.py
index aa0aeda..6a93cbd 100644
--- a/src/splitscreen_duo/__init__.py
+++ b/src/splitscreen_duo/__init__.py
@@ -1,17 +1,24 @@
from . import menu
import os
import logging
+import pygame
+from .serial import Serial
-logger = logging.getLogger(__name__)
+def main() -> int:
+ logger = logging.getLogger(__name__)
+ pygame.init()
-def main() -> int:
+ serial = Serial(os.getenv("SERIAL_DEVICE", "/dev/null"), 115200)
+ INSTANCE = os.getenv("INSTANCE", "Unknown")
+
+ pygame.display.set_caption(f"SplitScreen Duo Menu ({INSTANCE})")
logging.basicConfig(
level=(logging.DEBUG if os.getenv("DEVELOPMENT", "").lower() else logging.INFO)
)
print("The Dual Screen Console")
logger.info(f"Running as {os.getenv("INSTANCE", "unknown")}")
- menu.main_loop()
+ menu.main_loop(serial, INSTANCE)
return 0