forked from hishizuka/pizero_bikecomputer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpizero_bikecomputer.py
executable file
·43 lines (32 loc) · 1.13 KB
/
pizero_bikecomputer.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
40
41
#!/usr/bin/python3
import datetime
print("Loading original modules...")
t = datetime.datetime.now()
import modules
print("Loading modules... done :", (datetime.datetime.now()-t).total_seconds(),"sec")
def main():
time_profile = [datetime.datetime.now(),] #for time profile
config = modules.config.Config()
time_profile.append(datetime.datetime.now()) #for time profile
logger = modules.logger_core.LoggerCore(config)
config.set_logger(logger)
time_profile.append(datetime.datetime.now()) #for time profile
sec_diff = [] #for time profile
for i in range(len(time_profile)):
if i == 0:
continue
sec_diff.append("{0:.6f}".format((time_profile[i]-time_profile[i-1]).total_seconds()))
print("\tconfig/logger:", sec_diff)
gui = None
if config.G_GUI_MODE == "PyQt":
print("running in PyQt...")
gui = modules.gui_pyqt.GUI_PyQt(config)
#elif config.G_GUI_MODE == "QML":
# print("running in QML...")
# gui = modules.gui_qml.GUI_QML(config)
#elif config.G_GUI_MODE == "kivy":
# print("running in kivy...")
# gui = modules.gui_kivy.GUI_Kivy(config)
print("Bye")
if __name__ == "__main__":
main()