-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
40 lines (30 loc) · 926 Bytes
/
main.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
import os
import sys
root_dir = os.path.split(os.path.abspath(sys.argv[0]))[0]
sys.path.insert(0, os.path.join(root_dir, "libs", "applibs"))
import json # NOQA: E402
import traceback # NOQA: E402
from kivy.factory import Factory # NOQA: E402
from Demo_App import Demo_App # NOQA: E402
__version__ = "1.1.1"
"""
Registering factories from factory.json.
"""
r = Factory.register
with open("factory_registers.json") as fd:
custom_widgets = json.load(fd)
for module, _classes in custom_widgets.items():
for _class in _classes:
r(_class, module=module)
try:
Demo_App().run()
except Exception:
error = traceback.format_exc()
"""
If the app encounters an error it automatically saves the
error in a file called ERROR.log.
You can use this for BugReport purposes.
"""
with open("ERROR.log", "w") as error_file:
error_file.write(error)
print(error)