This repository was archived by the owner on Nov 10, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlaunch.py
More file actions
261 lines (207 loc) · 6.5 KB
/
launch.py
File metadata and controls
261 lines (207 loc) · 6.5 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
#!/usr/bin/env python3
"""
MASTER LAUNCHER ULTIMATE - FINAL LAUNCH SCRIPT
Commander Bobby Don McWilliams II - Authority Level 11.0
Complete production launch with validation
"""
import sys
import os
import subprocess
import time
from pathlib import Path
from datetime import datetime
PROJECT_ROOT = Path(__file__).parent
PYTHON = "H:\\Tools\\python.exe"
def print_header():
"""Print launch header"""
print("\n" + "="*80)
print("🎖️ MASTER LAUNCHER ULTIMATE - FINAL LAUNCH")
print("Commander Bobby Don McWilliams II - Authority Level 11.0")
print("="*80)
print(f"Time: {datetime.now().strftime('%Y-%m-%d %H:%M:%S')}")
print(f"Location: {PROJECT_ROOT}")
print("="*80 + "\n")
def check_python():
"""Check Python installation"""
print("🔍 Checking Python...")
if not Path(PYTHON).exists():
print(f"❌ Python not found at {PYTHON}")
return False
try:
result = subprocess.run(
[PYTHON, '--version'],
capture_output=True,
text=True,
timeout=5
)
version = result.stdout.strip()
print(f"✅ {version}")
return True
except Exception as e:
print(f"❌ Python check failed: {e}")
return False
def check_dependencies():
"""Check required dependencies"""
print("\n🔍 Checking dependencies...")
required = ['PyQt6', 'yaml', 'psutil']
optional = ['GPUtil']
all_ok = True
for package in required:
try:
result = subprocess.run(
[PYTHON, '-c', f'import {package}'],
capture_output=True,
timeout=5
)
if result.returncode == 0:
print(f"✅ {package}")
else:
print(f"❌ {package} - REQUIRED")
all_ok = False
except:
print(f"❌ {package} - REQUIRED")
all_ok = False
for package in optional:
try:
result = subprocess.run(
[PYTHON, '-c', f'import {package}'],
capture_output=True,
timeout=5
)
if result.returncode == 0:
print(f"✅ {package} (optional)")
else:
print(f"⚠️ {package} - optional but recommended")
except:
print(f"⚠️ {package} - optional but recommended")
return all_ok
def check_files():
"""Check required files"""
print("\n🔍 Checking files...")
required_files = [
'master_launcher.py',
'config.yaml',
'requirements.txt'
]
required_dirs = [
'authentication',
'voice',
'core',
'discovery',
'monitoring',
'integrations',
'gui'
]
all_ok = True
for file in required_files:
if (PROJECT_ROOT / file).exists():
print(f"✅ {file}")
else:
print(f"❌ {file} - REQUIRED")
all_ok = False
for dir in required_dirs:
if (PROJECT_ROOT / dir).exists():
print(f"✅ {dir}/")
else:
print(f"❌ {dir}/ - REQUIRED")
all_ok = False
return all_ok
def check_servers():
"""Check server directory"""
print("\n🔍 Checking servers...")
server_path = Path("E:\\ECHO_XV4\\MLS\\servers")
if server_path.exists():
servers = [d for d in server_path.iterdir() if d.is_dir()]
print(f"✅ Server directory exists")
print(f" Found {len(servers)} server(s)")
return True
else:
print(f"⚠️ Server directory not found: {server_path}")
print(" System will work but with no servers to manage")
return True
def run_tests():
"""Run test suite"""
print("\n🧪 Running tests...")
test_file = PROJECT_ROOT / "tests" / "test_suite.py"
if not test_file.exists():
print("⚠️ Test suite not found - skipping tests")
return True
try:
result = subprocess.run(
[PYTHON, str(test_file)],
cwd=str(PROJECT_ROOT),
capture_output=True,
text=True,
timeout=60
)
if result.returncode == 0:
print("✅ All tests passed")
return True
else:
print("❌ Some tests failed")
print(result.stdout[-500:]) # Last 500 chars
return False
except Exception as e:
print(f"⚠️ Test execution failed: {e}")
return False
def show_summary(checks):
"""Show validation summary"""
print("\n" + "="*80)
print("📊 VALIDATION SUMMARY")
print("="*80)
total = len(checks)
passed = sum(1 for c in checks.values() if c)
for name, status in checks.items():
symbol = "✅" if status else "❌"
print(f"{symbol} {name}")
print(f"\nResult: {passed}/{total} checks passed")
if passed == total:
print("\n🎉 ALL SYSTEMS GO!")
return True
else:
print("\n⚠️ SOME CHECKS FAILED")
return False
def launch_system():
"""Launch the system"""
print("\n" + "="*80)
print("🚀 LAUNCHING SYSTEM")
print("="*80 + "\n")
try:
print("Starting Master Launcher Ultimate...")
print(f"Command: {PYTHON} master_launcher.py")
print()
# Launch with direct output
subprocess.run(
[PYTHON, str(PROJECT_ROOT / "master_launcher.py")],
cwd=str(PROJECT_ROOT)
)
except KeyboardInterrupt:
print("\n\n⏸️ Launch interrupted by user")
except Exception as e:
print(f"\n❌ Launch failed: {e}")
def main():
"""Main launch sequence"""
print_header()
# Run all checks
checks = {
'Python Installation': check_python(),
'Dependencies': check_dependencies(),
'Required Files': check_files(),
'Server Directory': check_servers(),
'Test Suite': run_tests()
}
# Show summary
all_ok = show_summary(checks)
if not all_ok:
print("\n⚠️ Fix issues before launching")
print("Run: H:\\Tools\\python.exe -m pip install -r requirements.txt")
sys.exit(1)
# Ask to launch
print("\n" + "="*80)
response = input("Launch Master Launcher Ultimate? (y/n): ")
if response.lower() == 'y':
launch_system()
else:
print("\n✅ Launch cancelled")
if __name__ == '__main__':
main()