-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
executable file
·33 lines (27 loc) · 1.08 KB
/
main.py
File metadata and controls
executable file
·33 lines (27 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env python3
import sys
import os
# Add the project root to the Python path. This allows Python to find the 'spacehoarder' package.
project_root = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, project_root)
# Now, import everything from within the 'spacehoarder' package
from spacehoarder import config
from spacehoarder import utils
from spacehoarder.main_window import SpaceHoarderApp # Correctly import the App class
import re
if __name__ == "__main__":
# The logic that was here is now part of the package itself.
# We just need to find and run the app.
# Populate config.COLORS
try:
hexColors = re.findall(r"[0-9a-fA-F]{6}", config.COLORS_STRING)
config.COLORS = [utils.hex2tuple(x) for x in hexColors]
except Exception as e:
print(f"Error parsing COLORS_STRING: {e}")
config.COLORS = [(1, 0, 0)] # Fallback red
if not config.COLORS:
print("Error: Color configuration failed. Exiting.")
sys.exit(1)
app = SpaceHoarderApp()
exit_status = app.run(sys.argv)
sys.exit(exit_status)