Python-With-Gtk-Template/src/app.py

41 lines
1.0 KiB
Python
Raw Normal View History

2022-02-25 23:53:58 +00:00
# Python imports
import os
import time
2022-02-25 23:53:58 +00:00
# Lib imports
# Application imports
2022-09-05 23:01:39 +00:00
from utils.ipc_server import IPCServer
from core.window import Window
2022-02-25 23:53:58 +00:00
2023-01-29 06:06:52 +00:00
class AppLaunchException(Exception):
2022-09-05 23:01:39 +00:00
...
2022-02-25 23:53:58 +00:00
class ControllerStartExceptiom(Exception):
2022-09-05 23:01:39 +00:00
...
2022-02-25 23:53:58 +00:00
2022-09-05 23:01:39 +00:00
class Application(IPCServer):
2022-02-25 23:53:58 +00:00
''' Create Settings and Controller classes. Bind signal to Builder. Inherit from Builtins to bind global methods and classes.'''
def __init__(self, args, unknownargs):
2022-09-05 23:01:39 +00:00
super(Application, self).__init__()
if not settings.is_trace_debug():
2022-10-23 04:26:13 +00:00
try:
self.create_ipc_listener()
except Exception:
...
2022-09-05 23:01:39 +00:00
if not self.is_ipc_alive:
2022-10-23 04:26:13 +00:00
for arg in unknownargs + [args.new_tab,]:
if os.path.isdir(arg):
message = f"FILE|{arg}"
self.send_ipc_message(message)
2022-02-25 23:53:58 +00:00
2022-10-23 04:26:13 +00:00
raise AppLaunchException(f"{app_name} IPC Server Exists: Will send path(s) to it and close...")
2022-02-25 23:53:58 +00:00
Window(args, unknownargs)