Repository navigation
Expand file tree
/
Copy pathmain.py
More file actions
118 lines (86 loc) · 3.1 KB
/
Copy pathmain.py
File metadata and controls
118 lines (86 loc) · 3.1 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
# -*- coding: UTF-8 -*-
"""Main entry point for PDF to Word converter application.
PDF转Word转换器应用程序的主入口点。
This is the main entry point for the PDF to Word GUI application.
It initializes the application and shows the main window.
这是PDF转Word GUI应用程序的主入口点。
它初始化应用程序并显示主窗口。
"""
import sys
from PyQt5.QtWidgets import QApplication
from views.main_window import MainWindow
from models.converter import PDFConverter
from utils.file_manager import FileManager
from controllers.converter_controller import ConverterController
def main():
"""Main function to start the application.
启动应用程序的主函数。
This function creates the application instance, initializes all components,
and starts the event loop.
该函数创建应用程序实例,初始化所有组件,并启动事件循环。
"""
# Create application instance
# 创建应用程序实例
app = QApplication(sys.argv)
app.setApplicationName('PDF转Word工具')
# Create model instances
# 创建模型实例
converter = PDFConverter()
file_manager = FileManager()
# Create view
# 创建视图
main_window = MainWindow()
# Create controller
# 创建控制器
controller = ConverterController(main_window, converter, file_manager)
# Show main window
# 显示主窗口
main_window.show()
# Start event loop
# 启动事件循环
sys.exit(app.exec_())
if __name__ == '__main__':
main()
# -*- coding: UTF-8 -*-
"""Main entry point for PDF to Word converter application.
PDF转Word转换器应用程序的主入口点。
This is the main entry point for the PDF to Word GUI application.
It initializes the application and shows the main window.
这是PDF转Word GUI应用程序的主入口点。
它初始化应用程序并显示主窗口。
"""
import sys
from PyQt5.QtWidgets import QApplication
from views.main_window import MainWindow
from models.converter import PDFConverter
from utils.file_manager import FileManager
from controllers.converter_controller import ConverterController
def main():
"""Main function to start the application.
启动应用程序的主函数。
This function creates the application instance, initializes all components,
and starts the event loop.
该函数创建应用程序实例,初始化所有组件,并启动事件循环。
"""
# Create application instance
# 创建应用程序实例
app = QApplication(sys.argv)
app.setApplicationName('PDF转Word工具')
# Create model instances
# 创建模型实例
converter = PDFConverter()
file_manager = FileManager()
# Create view
# 创建视图
main_window = MainWindow()
# Create controller
# 创建控制器
controller = ConverterController(main_window, converter, file_manager)
# Show main window
# 显示主窗口
main_window.show()
# Start event loop
# 启动事件循环
sys.exit(app.exec_())
if __name__ == '__main__':
main()