SolarFM/src/versions/solarfm-0.0.1/SolarFM/solarfm/__main__.py

44 lines
1.2 KiB
Python
Raw Normal View History

2021-10-10 06:45:55 +00:00
#!/usr/bin/python3
# Python imports
import argparse, faulthandler, traceback
2021-10-10 06:45:55 +00:00
from setproctitle import setproctitle
import tracemalloc
tracemalloc.start()
# Lib imports
import gi
2021-10-10 06:45:55 +00:00
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
2021-10-10 06:45:55 +00:00
# Application imports
from __builtins__ import *
2022-03-03 22:45:37 +00:00
from app import Application
2021-10-10 06:45:55 +00:00
if __name__ == "__main__":
""" Set process title, get arguments, and create GTK main thread. """
2021-10-10 06:45:55 +00:00
try:
2022-01-27 01:47:59 +00:00
setproctitle('SolarFM')
2021-10-10 06:45:55 +00:00
faulthandler.enable() # For better debug info
2022-09-03 01:15:20 +00:00
2021-10-10 06:45:55 +00:00
parser = argparse.ArgumentParser()
# Add long and short arguments
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.")
2021-11-25 08:21:10 +00: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 06:45:55 +00:00
# Read arguments (If any...)
2021-11-25 08:21:10 +00:00
args, unknownargs = parser.parse_known_args()
2022-03-03 22:45:37 +00:00
Application(args, unknownargs)
Gtk.main()
2021-10-10 06:45:55 +00:00
except Exception as e:
traceback.print_exc()
quit()