Cleanup of widgets, fixing or updating plugins

This commit is contained in:
2023-03-04 21:45:29 -06:00
parent cbcdeaa037
commit 3c72ad2801
40 changed files with 355 additions and 914 deletions

View File

@@ -59,23 +59,27 @@ class IPCServer:
while True:
msg = conn.recv()
if "SEARCH|" in msg:
ts, file = msg.split("SEARCH|")[1].strip().split("|", 1)
try:
try:
if "SEARCH_DONE|" in msg:
ts, ret_code = msg.split("SEARCH_DONE|")[1].strip().split("|", 1)
timestamp = float(ts)
if timestamp > self.fsearch_time_stamp and file:
GLib.idle_add(self._load_file_ui, file, priority=GLib.PRIORITY_LOW)
except Exception as e:
...
if self.fsearch_time_stamp or self.grep_time_stamp:
if (timestamp > self.fsearch_time_stamp) or (timestamp > self.grep_time_stamp):
GLib.idle_add(self.stop_spinner, (ret_code,), priority=GLib.PRIORITY_HIGH_IDLE)
if "GREP|" in msg:
ts, data = msg.split("GREP|")[1].strip().split("|", 1)
try:
if "SEARCH|" in msg:
ts, file = msg.split("SEARCH|")[1].strip().split("|", 1)
timestamp = float(ts)
if timestamp > self.grep_time_stamp and data:
GLib.idle_add(self._load_grep_ui, data, priority=GLib.PRIORITY_LOW)
except Exception as e:
...
if file and (timestamp > self.fsearch_time_stamp):
GLib.idle_add(self._load_file_ui, file, priority=GLib.PRIORITY_HIGH_IDLE)
if "GREP|" in msg:
ts, data = msg.split("GREP|")[1].strip().split("|", 1)
timestamp = float(ts)
if data and (timestamp > self.grep_time_stamp):
GLib.idle_add(self._load_grep_ui, data, priority=GLib.PRIORITY_HIGH_IDLE)
except Exception as e:
print( repr(e) )
conn.close()

View File

@@ -82,12 +82,11 @@ def grep_search(target=None, query=None):
collection[f"{b64_file}"] = {}
collection[f"{b64_file}"] = { f"{line_no}": b64_data}
data = f"GREP|{ts}|{json.dumps(collection, separators=(',', ':'), indent=4)}"
send_ipc_message(data)
except Exception as e:
traceback.print_exc()
data = f"GREP|{ts}|{json.dumps(collection, separators=(',', ':'), indent=4)}"
send_ipc_message(data)
collection = {}
@@ -112,5 +111,11 @@ if __name__ == "__main__":
# Read arguments (If any...)
args = parser.parse_args()
search(args)
data = f"SEARCH_DONE|{ts}|0"
send_ipc_message(data)
except Exception as e:
traceback.print_exc()
data = f"SEARCH_DONE|{ts}|1"
send_ipc_message(data)