-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVSCP4CANToolBox.pyw
More file actions
46 lines (34 loc) · 1.23 KB
/
VSCP4CANToolBox.pyw
File metadata and controls
46 lines (34 loc) · 1.23 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
# pylint: disable=invalid-name
"""
VSCP4CAN Toolbox Application Entry Point.
This script serves as the bootstrap for the VSCP4CAN Toolbox application.
It handles the initialization of the backend server, configures the
asynchronous execution wrapper for Tkinter, and manages the application's
main lifecycle loop.
@file VSCP4CANToolBox.pyw
@copyright SPDX-FileCopyrightText: Copyright 2024-2026 by Michal Protasowicki
@license SPDX-License-Identifier: MIT
"""
import tk_async_execute as tae
from gui import app, server
def main():
"""
Initialize and run the main application lifecycle.
This function performs the following operations:
1. Starts the communication server.
2. Initializes the async executor for non-blocking UI operations.
3. Launches the Tkinter main event loop (blocking).
4. Handles graceful shutdown of services when the window is closed.
"""
# Start the backend server logic
server.start()
# Initialize the thread/async wrapper for Tkinter
tae.start()
# Start the GUI event loop (blocks until window is closed)
app.mainloop()
# Cleanup: Stop the async executor
tae.stop()
# Cleanup: Stop the backend server
server.stop()
if __name__ == "__main__":
main()