-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheck_files.py
More file actions
49 lines (39 loc) · 1.17 KB
/
check_files.py
File metadata and controls
49 lines (39 loc) · 1.17 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
#!/usr/bin/env python
import os
import sys
def resource_path(relative_path):
try:
base_path = sys._MEIPASS
except Exception:
base_path = os.path.abspath(".")
return os.path.join(base_path, relative_path)
def check_required_files(file_list):
missing = []
for f in file_list:
if not os.path.exists(resource_path(f)):
missing.append(f)
return missing
def main():
required_files = [
"resources/skins/classic.qss",
"resources/fonts/W95FA.otf",
"resources/icons/qwicon.png",
"resources/icons/play.png",
"resources/icons/pause.png",
"resources/icons/stop.png",
"resources/icons/next.png",
"resources/icons/prev.png",
"resources/images/bgmin.png",
"resources/user_config.json",
"audio"
]
missing = check_required_files(required_files)
if missing:
print("Hiba: A következő fájl(ok)/mappa(k) hiányoznak:")
for item in missing:
print(" -", item)
sys.exit(1)
else:
print("Minden szükséges fájl és mappa megtalálható.")
if __name__ == "__main__":
main()