42 lines
1.2 KiB
Python
42 lines
1.2 KiB
Python
#!/usr/bin/python3
|
|
|
|
|
|
# Python imports
|
|
import argparse, faulthandler, traceback
|
|
from setproctitle import setproctitle
|
|
|
|
# Lib imports
|
|
|
|
|
|
# Application imports
|
|
from app import Application
|
|
|
|
|
|
def run():
|
|
try:
|
|
setproctitle('Ursina Game')
|
|
faulthandler.enable() # For better debug info
|
|
|
|
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.")
|
|
parser.add_argument("--no-plugins", "-np", default="false", help="Do not load plugins.")
|
|
|
|
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.")
|
|
|
|
# Read arguments (If any...)
|
|
args, unknownargs = parser.parse_known_args()
|
|
|
|
app = Application(args, unknownargs)
|
|
app.run()
|
|
except Exception as e:
|
|
traceback.print_exc()
|
|
quit()
|
|
|
|
|
|
if __name__ == "__main__":
|
|
''' Set process title, get arguments, and create Ursina main thread. '''
|
|
run()
|