-
Notifications
You must be signed in to change notification settings - Fork 0
/
PPIM.py
39 lines (33 loc) · 1.16 KB
/
PPIM.py
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
import customtkinter as ctk
from Controllers.Mongo import MongoDB
from Controllers.System import System
import ctypes, sys
ctk.set_appearance_mode("System") # Modes: "System" (standard), "Dark", "Light"
ctk.set_default_color_theme("blue") # Themes: "blue" (standard), "green", "dark-blue"
if __name__ == "__main__":
try:
client = MongoDB()
client.StartService()
client.Connect(
"mongodb://localhost:27017/?directConnection=true&serverSelectionTimeoutMS=2000&appName=PPIM",
)
ppim = client.Connect(dbName='PPIM')
try:
systemInfo = ppim.get_collection('System').find_one()
except:
systemInfo = None
except:
ppim = None
systemInfo = None
mongo = System().get_service('MongoDB')
if ppim != None and systemInfo != None:
from GUI.Main import App
app = App(client,ppim)
elif mongo != None and systemInfo == None:
from GUI.Config import App
app = App()
else:
from GUI.Install import App
app = App()
app.eval('tk::PlaceWindow . center')
ctypes.windll.shell32.ShellExecuteW(None, "runas", app.mainloop(), " ".join(sys.argv), None, 1)