# Python imports import os # Lib imports # Application imports from utils.ipc_server import IPCServer from core.window import Window class AppLaunchException(Exception): ... class Application(IPCServer): """ docstring for Application. """ def __init__(self, args, unknownargs): super(Application, self).__init__() if not settings.is_trace_debug(): try: self.create_ipc_listener() except Exception: ... if not self.is_ipc_alive: collection = unknownargs + [args.file] if args.file and os.path.isfile(args.file) else unknownargs for arg in collection: path = arg.replace("file://", "") if os.path.isfile(path): message = f"FILE|{path}" self.send_ipc_message(message) raise AppLaunchException(f"{app_name} IPC Server Exists: Will send path(s) to it and close...") Window(args, unknownargs)