-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdroidmgr.py
More file actions
executable file
·60 lines (45 loc) · 1.48 KB
/
droidmgr.py
File metadata and controls
executable file
·60 lines (45 loc) · 1.48 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
#!/usr/bin/env python3
"""droidmgr - GUI frontend for scrcpy.
This is the main entry point for the application.
It automatically initializes and starts the UI.
"""
import sys
from pathlib import Path
# Add src to path
sys.path.insert(0, str(Path(__file__).parent / 'src'))
from ui import MainWindow, InitDialog
def main():
"""Main entry point for droidmgr."""
print("Starting droidmgr...")
print("Checking dependencies...")
# Try to get existing paths first
from core import DependencyManager
dep_manager = DependencyManager()
adb_path = None
scrcpy_path = None
show_dialog = False
try:
adb_path = dep_manager.get_adb_path()
print(f"✓ ADB found at: {adb_path}")
except RuntimeError:
print("✗ ADB not found")
show_dialog = True
try:
scrcpy_path = dep_manager.get_scrcpy_path()
print(f"✓ scrcpy found at: {scrcpy_path}")
except RuntimeError:
print("✗ scrcpy not found")
show_dialog = True
# Only show initialization dialog if dependencies are missing
if show_dialog:
print("Initializing missing dependencies...")
init_dialog = InitDialog()
success, adb_path, scrcpy_path = init_dialog.run()
if not success:
print("Initialization cancelled or failed.")
return
print("Starting UI...")
app = MainWindow(adb_path, scrcpy_path)
app.run()
if __name__ == '__main__':
main()