Mouse_Keyboard/src/__main__.py

46 lines
1.3 KiB
Python
Raw Permalink Normal View History

2022-02-15 08:11:00 +00:00
#!/usr/bin/python3
# Python imports
2023-03-03 04:03:53 +00:00
import argparse
import faulthandler
import traceback
2022-02-15 08:11:00 +00:00
from setproctitle import setproctitle
2022-08-28 23:47:15 +00:00
import tracemalloc
tracemalloc.start()
# Lib imports
2022-02-15 08:11:00 +00:00
# Application imports
from __builtins__ import *
2022-08-28 23:47:15 +00:00
from app import Application
2022-02-15 08:11:00 +00:00
2023-03-03 04:03:53 +00:00
def main(args, unknownargs):
setproctitle(f'{app_name}')
Application(args, unknownargs)
2022-02-15 08:11:00 +00:00
if __name__ == "__main__":
''' Set process title, get arguments, and create GTK main thread. '''
2022-08-28 23:47:15 +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.")
parser.add_argument("--no-plugins", "-np", default="false", help="Do not load plugins.")
2022-08-28 23:47:15 +00:00
parser.add_argument("--new-tab", "-nt", default="false", help="Opens a 'New Tab' if a handler is set for it.")
parser.add_argument("--file", "-f", default="default", help="JUST SOME FILE ARG.")
2022-02-15 08:11:00 +00:00
# Read arguments (If any...)
args, unknownargs = parser.parse_known_args()
2022-08-28 23:47:15 +00:00
try:
faulthandler.enable() # For better debug info
main(args, unknownargs)
2022-02-15 08:11:00 +00:00
except Exception as e:
2022-08-28 23:47:15 +00:00
traceback.print_exc()
quit()