Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2c453bc621 | |||
| 530fe7c3ab | |||
| 5e5cc50ba8 |
29
src/app.py
29
src/app.py
@@ -23,13 +23,14 @@ class Application:
|
|||||||
def __init__(self):
|
def __init__(self):
|
||||||
super(Application, self).__init__()
|
super(Application, self).__init__()
|
||||||
|
|
||||||
if not settings_manager.is_trace_debug():
|
|
||||||
self.load_ipc()
|
|
||||||
|
|
||||||
self.setup_debug_hook()
|
self.setup_debug_hook()
|
||||||
|
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
|
if not settings_manager.is_trace_debug():
|
||||||
|
if not self.load_ipc():
|
||||||
|
return
|
||||||
|
|
||||||
win = Window()
|
win = Window()
|
||||||
win.start()
|
win.start()
|
||||||
|
|
||||||
@@ -39,13 +40,20 @@ class Application:
|
|||||||
ipc_server = IPCServer()
|
ipc_server = IPCServer()
|
||||||
|
|
||||||
self.ipc_realization_check(ipc_server)
|
self.ipc_realization_check(ipc_server)
|
||||||
if not ipc_server.is_ipc_alive:
|
if ipc_server.is_ipc_alive:
|
||||||
for arg in unknownargs + [args.new_tab,]:
|
return True
|
||||||
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...")
|
logger.warning(f"{app_name} IPC Server Exists: Have sent path(s) to it and closing...")
|
||||||
|
for arg in unknownargs + [args.new_tab,]:
|
||||||
|
if os.path.isfile(arg):
|
||||||
|
message = f"FILE|{arg}"
|
||||||
|
ipc_server.send_ipc_message(message)
|
||||||
|
|
||||||
|
if os.path.isdir(arg):
|
||||||
|
message = f"DIR|{arg}"
|
||||||
|
ipc_server.send_ipc_message(message)
|
||||||
|
|
||||||
|
return False
|
||||||
|
|
||||||
def ipc_realization_check(self, ipc_server):
|
def ipc_realization_check(self, ipc_server):
|
||||||
try:
|
try:
|
||||||
@@ -53,9 +61,6 @@ class Application:
|
|||||||
except Exception:
|
except Exception:
|
||||||
ipc_server.send_test_ipc_message()
|
ipc_server.send_test_ipc_message()
|
||||||
|
|
||||||
with suppress(Exception):
|
|
||||||
ipc_server.create_ipc_listener()
|
|
||||||
|
|
||||||
def setup_debug_hook(self):
|
def setup_debug_hook(self):
|
||||||
# Typically: ValueError: signal only works in main thread
|
# Typically: ValueError: signal only works in main thread
|
||||||
with suppress(ValueError):
|
with suppress(ValueError):
|
||||||
|
|||||||
@@ -93,6 +93,9 @@ class VteWidget(Vte.Terminal):
|
|||||||
if not text.encode() == "\r".encode(): return
|
if not text.encode() == "\r".encode(): return
|
||||||
|
|
||||||
text, attributes = self.get_text()
|
text, attributes = self.get_text()
|
||||||
|
|
||||||
|
if not text: return
|
||||||
|
|
||||||
lines = text.strip().splitlines()
|
lines = text.strip().splitlines()
|
||||||
command_ran = None
|
command_ran = None
|
||||||
|
|
||||||
|
|||||||
@@ -61,8 +61,12 @@ class IPCServer(Singleton):
|
|||||||
conn = listener.accept()
|
conn = listener.accept()
|
||||||
start_time = time.perf_counter()
|
start_time = time.perf_counter()
|
||||||
self._handle_ipc_message(conn, start_time)
|
self._handle_ipc_message(conn, start_time)
|
||||||
|
except EOFError as e:
|
||||||
|
logger.debug( repr(e) )
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.debug( repr(e) )
|
logger.debug( repr(e) )
|
||||||
|
finally:
|
||||||
|
conn.close()
|
||||||
|
|
||||||
listener.close()
|
listener.close()
|
||||||
|
|
||||||
@@ -88,7 +92,7 @@ class IPCServer(Singleton):
|
|||||||
break
|
break
|
||||||
|
|
||||||
|
|
||||||
if msg in ['close connection', 'close server']:
|
if msg in ['close connection', 'close server', 'Empty Data...']:
|
||||||
conn.close()
|
conn.close()
|
||||||
break
|
break
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
"open-terminal" : "F4",
|
"open-terminal" : "F4",
|
||||||
"refresh-tab" : ["F5", "<Control>r"],
|
"refresh-tab" : ["F5", "<Control>r"],
|
||||||
"delete-files" : "Delete",
|
"delete-files" : "Delete",
|
||||||
|
"load-interactive-debug" : "<Control>d",
|
||||||
"tggl-top-main-menubar" : "Alt_L",
|
"tggl-top-main-menubar" : "Alt_L",
|
||||||
"tggl-top-main-menubar" : "<Control>0",
|
"tggl-top-main-menubar" : "<Control>0",
|
||||||
"trash-files" : "<Shift><Control>t",
|
"trash-files" : "<Shift><Control>t",
|
||||||
|
|||||||
@@ -1,6 +1,24 @@
|
|||||||
/* ---- Make most desired things base transparent ---- */
|
/* ---- Make most desired things base transparent ---- */
|
||||||
popover,
|
popover,
|
||||||
popover > box,
|
popover > box,
|
||||||
|
notebook,
|
||||||
|
header,
|
||||||
|
stack,
|
||||||
|
scrolledwindow,
|
||||||
|
viewport {
|
||||||
|
background: rgba(0, 0, 0, 0.0);
|
||||||
|
color: rgba(255, 255, 255, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
tab {
|
||||||
|
color: rgba(255, 255, 255, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
tab:checked {
|
||||||
|
border-bottom-color: rgba(125, 125, 125, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
.main-window,
|
.main-window,
|
||||||
.base-container,
|
.base-container,
|
||||||
.body-container,
|
.body-container,
|
||||||
@@ -13,6 +31,7 @@ popover > box,
|
|||||||
color: rgba(255, 255, 255, 1);
|
color: rgba(255, 255, 255, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.base-container {
|
.base-container {
|
||||||
margin: 10px;
|
margin: 10px;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user