2020-05-08 00:07:33 +00:00
|
|
|
#!/usr/bin/python3
|
|
|
|
|
|
|
|
# Python imports
|
2022-10-14 01:58:44 +00:00
|
|
|
import argparse
|
|
|
|
import faulthandler
|
|
|
|
import traceback
|
2020-05-08 00:07:33 +00:00
|
|
|
from setproctitle import setproctitle
|
|
|
|
|
2022-01-23 22:56:27 +00:00
|
|
|
import tracemalloc
|
|
|
|
tracemalloc.start()
|
|
|
|
|
|
|
|
# Lib imports
|
|
|
|
import gi
|
2020-05-08 00:07:33 +00:00
|
|
|
gi.require_version('Gtk', '3.0')
|
2022-01-23 22:56:27 +00:00
|
|
|
from gi.repository import Gtk
|
2020-05-08 00:07:33 +00:00
|
|
|
|
|
|
|
# Application imports
|
2022-10-14 01:58:44 +00:00
|
|
|
from __builtins__ import *
|
2022-03-03 22:37:29 +00:00
|
|
|
from app import Application
|
2020-05-08 00:07:33 +00:00
|
|
|
|
|
|
|
|
2023-01-29 06:06:52 +00:00
|
|
|
|
|
|
|
|
2020-05-08 00:07:33 +00:00
|
|
|
if __name__ == "__main__":
|
2022-02-25 23:53:58 +00:00
|
|
|
''' Set process title, get arguments, and create GTK main thread. '''
|
|
|
|
|
2020-05-08 00:07:33 +00:00
|
|
|
try:
|
2022-10-14 02:19:40 +00:00
|
|
|
setproctitle(f'{app_name}')
|
2020-05-08 00:07:33 +00:00
|
|
|
faulthandler.enable() # For better debug info
|
2022-10-14 01:58:44 +00:00
|
|
|
|
2020-05-08 00:07:33 +00:00
|
|
|
parser = argparse.ArgumentParser()
|
|
|
|
# Add long and short arguments
|
2022-10-14 01:58:44 +00:00
|
|
|
parser.add_argument("--debug", "-d", default="false", help="Do extra console messaging.")
|
|
|
|
parser.add_argument("--trace-debug", "-td", default="false", help="Disable saves, ignore IPC lock, do extra console messaging.")
|
2020-05-08 00:07:33 +00:00
|
|
|
parser.add_argument("--file", "-f", default="default", help="JUST SOME FILE ARG.")
|
|
|
|
|
|
|
|
# Read arguments (If any...)
|
2022-01-23 22:56:27 +00:00
|
|
|
args, unknownargs = parser.parse_known_args()
|
|
|
|
|
2022-10-23 04:26:13 +00:00
|
|
|
if args.debug == "true":
|
|
|
|
settings.set_debug(True)
|
|
|
|
|
|
|
|
if args.trace_debug == "true":
|
|
|
|
settings.set_trace_debug(True)
|
|
|
|
|
|
|
|
settings.do_dirty_start_check()
|
2022-03-03 22:37:29 +00:00
|
|
|
Application(args, unknownargs)
|
2022-01-23 22:56:27 +00:00
|
|
|
Gtk.main()
|
2020-05-08 00:07:33 +00:00
|
|
|
except Exception as e:
|
2022-01-23 22:56:27 +00:00
|
|
|
traceback.print_exc()
|
|
|
|
quit()
|