2023-03-18 04:17:38 +00:00
|
|
|
# Python imports
|
|
|
|
import os
|
|
|
|
|
|
|
|
# Lib imports
|
|
|
|
|
|
|
|
# Application imports
|
|
|
|
from utils.ipc_server import IPCServer
|
|
|
|
from core.window import Window
|
|
|
|
|
|
|
|
|
2023-10-07 19:51:12 +00:00
|
|
|
|
2023-03-18 04:17:38 +00:00
|
|
|
class AppLaunchException(Exception):
|
|
|
|
...
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Application(IPCServer):
|
|
|
|
''' Create Settings and Controller classes. Bind signal to Builder. Inherit from Builtins to bind global methods and classes.'''
|
|
|
|
|
|
|
|
def __init__(self, args, unknownargs):
|
|
|
|
super(Application, self).__init__()
|
2023-10-03 23:22:36 +00:00
|
|
|
if not settings_manager.is_trace_debug():
|
2023-03-18 04:17:38 +00:00
|
|
|
try:
|
|
|
|
self.create_ipc_listener()
|
|
|
|
except Exception:
|
|
|
|
...
|
|
|
|
|
|
|
|
if not self.is_ipc_alive:
|
|
|
|
for arg in unknownargs + [args.new_tab,]:
|
2023-03-26 06:07:35 +00:00
|
|
|
if os.path.isfile(arg):
|
2023-03-18 04:17:38 +00:00
|
|
|
message = f"FILE|{arg}"
|
|
|
|
self.send_ipc_message(message)
|
|
|
|
|
|
|
|
raise AppLaunchException(f"{app_name} IPC Server Exists: Will send path(s) to it and close...")
|
|
|
|
|
2023-10-09 06:23:08 +00:00
|
|
|
Window(args, unknownargs)
|