-
Notifications
You must be signed in to change notification settings - Fork 0
/
launch.pyw
71 lines (60 loc) · 1.86 KB
/
launch.pyw
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
#!/usr/bin/python
import os, esES, enUS, signal, psutil
from modules import checkInternet
if os.name == "nt":
import wmi
from modules import osd
from sys import exit
running = False
if os.name == "nt":
sao = wmi.WMI()
for process in sao.Win32_Process():
if "SAO Utils.exe" == process.Name:
running = True
break
pids = []
for proc in psutil.process_iter():
if "A-D-Y" in proc.name():
pids.append(proc.pid)
for pid in pids:
if pid != os.getpid():
os.kill(pid, signal.SIGINT)
else:
continue
def main():
if os.name == "nt":
config = ".\\config.ini"
else:
config = "./config.ini"
with open(config, "r") as file:
line = file.readlines()
match line[0]:
case line if line[11:-1] == "'es-ES'":
internet = checkInternet.check()
if internet:
returned = esES.initial(True)
print(returned)
else:
returned = "sin conexión a internet disponible"
print(returned)
case line if line[11:-1] == "'en-US'":
internet = checkInternet.check()
if internet:
returned = enUS.initial(True)
print(returned)
else:
returned = "no internet connection available"
print(returned)
case _:
print(line[11:-1])
while True:
match returned:
case "spanish":
returned = esES.initial(True)
case "english":
returned = enUS.initial(True)
case _:
if os.name == "nt":
osd.end()
exit()
main()