refactoring pid logic; addedd window state preservation; slight thread rework
This commit is contained in:
@@ -16,35 +16,39 @@ class AppLaunchException(Exception):
|
||||
|
||||
|
||||
|
||||
class Application(IPCServer):
|
||||
class Application:
|
||||
""" docstring for Application. """
|
||||
|
||||
def __init__(self, args, unknownargs):
|
||||
super(Application, self).__init__()
|
||||
|
||||
if not settings_manager.is_trace_debug():
|
||||
self.socket_realization_check()
|
||||
|
||||
if not self.is_ipc_alive:
|
||||
for arg in unknownargs + [args.new_tab,]:
|
||||
if os.path.isdir(arg):
|
||||
message = f"FILE|{arg}"
|
||||
self.send_ipc_message(message)
|
||||
|
||||
raise AppLaunchException(f"{app_name} IPC Server Exists: Have sent path(s) to it and closing...")
|
||||
self.load_ipc(args, unknownargs)
|
||||
|
||||
self.setup_debug_hook()
|
||||
Window(args, unknownargs).main()
|
||||
|
||||
|
||||
def socket_realization_check(self):
|
||||
def load_ipc(self, args, unknownargs):
|
||||
ipc_server = IPCServer()
|
||||
self.ipc_realization_check(ipc_server)
|
||||
|
||||
if not ipc_server.is_ipc_alive:
|
||||
for arg in unknownargs + [args.new_tab,]:
|
||||
if os.path.isfile(arg):
|
||||
message = f"FILE|{arg}"
|
||||
ipc_server.send_ipc_message(message)
|
||||
|
||||
raise AppLaunchException(f"{app_name} IPC Server Exists: Have sent path(s) to it and closing...")
|
||||
|
||||
def ipc_realization_check(self, ipc_server):
|
||||
try:
|
||||
self.create_ipc_listener()
|
||||
ipc_server.create_ipc_listener()
|
||||
except Exception:
|
||||
self.send_test_ipc_message()
|
||||
ipc_server.send_test_ipc_message()
|
||||
|
||||
try:
|
||||
self.create_ipc_listener()
|
||||
ipc_server.create_ipc_listener()
|
||||
except Exception as e:
|
||||
...
|
||||
|
||||
|
Reference in New Issue
Block a user