-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.py
More file actions
37 lines (30 loc) · 929 Bytes
/
main.py
File metadata and controls
37 lines (30 loc) · 929 Bytes
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
import sys
from PyQt5.QtWidgets import QApplication
from src.ui.main_window import MainWindow
from src.utils.mongodb_client import mongodb_client
import logging
# Set up logging
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
def main():
"""
Main entry point of the DisasterConnect application
"""
try:
# Initialize the application
app = QApplication(sys.argv)
# Set application style
app.setStyle('Fusion')
# Create and show main window
main_window = MainWindow()
main_window.show()
# Start the application event loop
sys.exit(app.exec_())
except Exception as e:
logger.error(f"Application failed to start: {str(e)}")
sys.exit(1)
finally:
# Clean up resources
mongodb_client.close_connection()
if __name__ == '__main__':
main()