2021-10-10 01:45:55 -05:00
|
|
|
#!/usr/bin/python3
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Python imports
|
2021-12-06 22:44:39 -06:00
|
|
|
import argparse, faulthandler, traceback
|
2021-10-10 01:45:55 -05:00
|
|
|
from setproctitle import setproctitle
|
|
|
|
|
|
|
|
|
|
import tracemalloc
|
|
|
|
|
tracemalloc.start()
|
|
|
|
|
|
|
|
|
|
|
2021-12-06 22:44:39 -06:00
|
|
|
# Lib imports
|
|
|
|
|
import gi
|
2021-10-10 01:45:55 -05:00
|
|
|
gi.require_version('Gtk', '3.0')
|
2021-11-25 00:44:12 -06:00
|
|
|
from gi.repository import Gtk
|
2021-10-10 01:45:55 -05:00
|
|
|
|
|
|
|
|
# Application imports
|
2022-03-03 16:45:37 -06:00
|
|
|
from app import Application
|
2021-10-10 01:45:55 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
2022-02-20 01:32:51 -06:00
|
|
|
""" Set process title, get arguments, and create GTK main thread. """
|
2022-02-01 21:08:02 -06:00
|
|
|
|
2021-10-10 01:45:55 -05:00
|
|
|
try:
|
2021-12-27 00:33:30 -06:00
|
|
|
# import web_pdb
|
|
|
|
|
# web_pdb.set_trace()
|
|
|
|
|
|
2022-01-26 19:47:59 -06:00
|
|
|
setproctitle('SolarFM')
|
2021-10-10 01:45:55 -05:00
|
|
|
faulthandler.enable() # For better debug info
|
|
|
|
|
parser = argparse.ArgumentParser()
|
|
|
|
|
# Add long and short arguments
|
2021-11-25 02:21:10 -06:00
|
|
|
parser.add_argument("--new-tab", "-t", default="", help="Open a file into new tab.")
|
|
|
|
|
parser.add_argument("--new-window", "-w", default="", help="Open a file into a new window.")
|
2021-10-10 01:45:55 -05:00
|
|
|
|
|
|
|
|
# Read arguments (If any...)
|
2021-11-25 02:21:10 -06:00
|
|
|
args, unknownargs = parser.parse_known_args()
|
|
|
|
|
|
2022-03-03 16:45:37 -06:00
|
|
|
Application(args, unknownargs)
|
2021-11-25 00:44:12 -06:00
|
|
|
Gtk.main()
|
2021-10-10 01:45:55 -05:00
|
|
|
except Exception as e:
|
2021-12-24 23:58:57 -06:00
|
|
|
traceback.print_exc()
|
|
|
|
|
quit()
|