-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
39 lines (25 loc) · 737 Bytes
/
main.py
File metadata and controls
39 lines (25 loc) · 737 Bytes
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 gi
from UI import MainMenu
from Core.Settings import AppSettings, read, write
from Core.Constants.Config import path
import os
gi.require_version('Gio', '2.0')
from gi.repository import Gio
file_path = path()
base_path = os.path.abspath(os.path.dirname(__file__))
resource_path = os.path.join(base_path, 'onetimepadui.gresource')
resource = Gio.Resource.load(resource_path)
Gio.Resource._register(resource)
if file_path.exists() is not True:
app_settings = AppSettings()
write(str(file_path), app_settings)
else:
app_settings = None
app_settings = read(file_path)
def __init__():
global app_settings
global resource
win = MainMenu
win.main()
if __name__ == "__main__":
__init__()