-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
60 lines (49 loc) · 1.27 KB
/
main.py
File metadata and controls
60 lines (49 loc) · 1.27 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
"""
main.py - PDFuse entry point.
Checks dependencies and launches the application.
"""
import sys
REQUIRED = {
"customtkinter": "customtkinter",
"pypdf": "pypdf",
"reportlab": "reportlab",
"pandas": "pandas",
"openpyxl": "openpyxl",
"PIL": "Pillow",
"fitz": "pymupdf",
}
missing = []
for module, package in REQUIRED.items():
try:
__import__(module)
except ImportError:
missing.append(package)
if missing:
print("=" * 60)
print("ERROR: Faltan dependencias requeridas.")
print("Instálalas con:\n")
print(f" pip install {' '.join(missing)}")
print("=" * 60)
sys.exit(1)
def _set_taskbar_icon():
"""
On Windows, explicitly set the AppUserModelID so the OS groups the
window under PDFuse's own icon in the taskbar instead of python.exe.
Must be called before the Tk window is created.
"""
if sys.platform != "win32":
return
try:
import ctypes
ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID(
"pdfuse.app.1.0"
)
except Exception:
pass
def main():
_set_taskbar_icon()
from gui import PDFuseApp
app = PDFuseApp()
app.mainloop()
if __name__ == "__main__":
main()