BulkR/src/__main__.py

39 lines
902 B
Python
Raw Normal View History

2022-02-06 19:34:48 +00:00
#!/usr/bin/python3
# Python imports
2023-01-17 04:47:28 +00:00
import argparse
import faulthandler
2022-02-06 19:34:48 +00:00
from setproctitle import setproctitle
2023-01-17 04:47:28 +00:00
import signal
2022-02-06 19:34:48 +00:00
# Gtk imports
2023-01-17 04:47:28 +00:00
import gi
2022-02-06 19:34:48 +00:00
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
from gi.repository import GLib
# Application imports
2023-01-17 04:47:28 +00:00
from __builtins__ import *
from app import Application
2022-02-06 19:34:48 +00:00
if __name__ == "__main__":
try:
2023-01-17 04:47:28 +00:00
setproctitle('{app_name}')
2022-02-06 19:34:48 +00:00
GLib.unix_signal_add(GLib.PRIORITY_DEFAULT, signal.SIGINT, Gtk.main_quit)
faulthandler.enable() # For better debug info
parser = argparse.ArgumentParser()
# Add long and short arguments
2023-01-17 04:47:28 +00:00
parser.add_argument("--path", "-p", default=None, help="Path to folder.")
2022-02-06 19:34:48 +00:00
# Read arguments (If any...)
2023-01-17 04:47:28 +00:00
args, unknownargs = parser.parse_known_args()
Application(args, unknownargs)
2022-02-06 19:34:48 +00:00
Gtk.main()
except Exception as e:
print( repr(e) )