-
Notifications
You must be signed in to change notification settings - Fork 1
/
asset_builder.py
40 lines (32 loc) · 1.06 KB
/
asset_builder.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
#!/usr/bin/env python3
# A script for building character sprites out of paperdolls.
from app.globals import *
import app
import sys
def main():
try:
log.info("Initializing")
gui.create_context()
iapp = app.App(gui.window(tag="root", no_scrollbar=True))
gui.create_viewport(title=TITLE, small_icon=str(SMALL_ICON), large_icon=str(LARGE_ICON))
gui.setup_dearpygui()
gui.show_viewport()
gui.set_primary_window("root", True)
log.info("Finished initialization")
try:
gui.start_dearpygui()
finally:
log.info("Exiting")
iapp.close()
gui.destroy_context()
return 0
except Exception as e:
log.error("An unknown error occurred.", exc_info=True)
xdialog.error(message=f"An unknown error occurred and the program must exit;\n{e.__class__.__name__}: {str(e)}")
return 1
except KeyboardInterrupt:
try: iapp.close()
except NameError: pass
if __name__ == "__main__":
err = main()
if err: sys.exit(err)