From 59d67874ad523f1d269446d5b20f8319d2ad9984 Mon Sep 17 00:00:00 2001 From: itdominator <1itdominator@gmail.com> Date: Wed, 19 Jan 2022 23:49:19 -0600 Subject: [PATCH] New trace debug flag for when using trace module --- .../SolarFM/solarfm/__builtins__.py | 1 + .../solarfm-0.0.1/SolarFM/solarfm/__init__.py | 25 +++++++++++-------- .../shellfm/windows/WindowController.py | 4 ++- .../solarfm/signal_classes/Controller.py | 20 ++++++++------- 4 files changed, 29 insertions(+), 21 deletions(-) diff --git a/src/versions/solarfm-0.0.1/SolarFM/solarfm/__builtins__.py b/src/versions/solarfm-0.0.1/SolarFM/solarfm/__builtins__.py index 499839f..be64d81 100644 --- a/src/versions/solarfm-0.0.1/SolarFM/solarfm/__builtins__.py +++ b/src/versions/solarfm-0.0.1/SolarFM/solarfm/__builtins__.py @@ -64,3 +64,4 @@ class Builtins(IPCServerMixin): builtins.event_system = Builtins() builtins.event_sleep_time = 0.2 builtins.debug = False +builtins.trace_debug = False diff --git a/src/versions/solarfm-0.0.1/SolarFM/solarfm/__init__.py b/src/versions/solarfm-0.0.1/SolarFM/solarfm/__init__.py index 5fed289..68a0396 100644 --- a/src/versions/solarfm-0.0.1/SolarFM/solarfm/__init__.py +++ b/src/versions/solarfm-0.0.1/SolarFM/solarfm/__init__.py @@ -13,20 +13,23 @@ from __builtins__ import Builtins class Main(Builtins): def __init__(self, args, unknownargs): - event_system.create_ipc_server() + if not debug: + event_system.create_ipc_server() + time.sleep(0.2) - if not event_system.is_ipc_alive: - if unknownargs: - for arg in unknownargs: - if os.path.isdir(arg): - message = f"FILE|{arg}" - event_system.send_ipc_message(message) + if not trace_debug: + if not event_system.is_ipc_alive: + if unknownargs: + for arg in unknownargs: + if os.path.isdir(arg): + message = f"FILE|{arg}" + event_system.send_ipc_message(message) - if args.new_tab and os.path.isdir(args.new_tab): - message = f"FILE|{args.new_tab}" - event_system.send_ipc_message(message) + if args.new_tab and os.path.isdir(args.new_tab): + message = f"FILE|{args.new_tab}" + event_system.send_ipc_message(message) - raise Exception("IPC Server Exists: Will send path(s) to it and close...") + raise Exception("IPC Server Exists: Will send path(s) to it and close...") settings = Settings() diff --git a/src/versions/solarfm-0.0.1/SolarFM/solarfm/shellfm/windows/WindowController.py b/src/versions/solarfm-0.0.1/SolarFM/solarfm/shellfm/windows/WindowController.py index e8f75ad..7f068e7 100644 --- a/src/versions/solarfm-0.0.1/SolarFM/solarfm/shellfm/windows/WindowController.py +++ b/src/versions/solarfm-0.0.1/SolarFM/solarfm/shellfm/windows/WindowController.py @@ -24,7 +24,9 @@ class WindowController: self.active_window_id = "" self.active_tab_id = "" self.windows = [] - self.fm_event_observer() + + if not trace_debug: + self.fm_event_observer() @threaded def fm_event_observer(self): diff --git a/src/versions/solarfm-0.0.1/SolarFM/solarfm/signal_classes/Controller.py b/src/versions/solarfm-0.0.1/SolarFM/solarfm/signal_classes/Controller.py index 5354c5e..8fb42a4 100644 --- a/src/versions/solarfm-0.0.1/SolarFM/solarfm/signal_classes/Controller.py +++ b/src/versions/solarfm-0.0.1/SolarFM/solarfm/signal_classes/Controller.py @@ -31,17 +31,19 @@ class Controller(WidgetFileActionMixin, PaneMixin, WindowMixin, ShowHideMixin, \ self.window.connect("delete-event", self.tear_down) GLib.unix_signal_add(GLib.PRIORITY_DEFAULT, signal.SIGINT, self.tear_down) - self.gui_event_observer() - if unknownargs: - for arg in unknownargs: - if os.path.isdir(arg): - message = f"FILE|{arg}" - event_system.send_ipc_message(message) + if not trace_debug: + self.gui_event_observer() - if args.new_tab and os.path.isdir(args.new_tab): - message = f"FILE|{args.new_tab}" - event_system.send_ipc_message(message) + if unknownargs: + for arg in unknownargs: + if os.path.isdir(arg): + message = f"FILE|{arg}" + event_system.send_ipc_message(message) + + if args.new_tab and os.path.isdir(args.new_tab): + message = f"FILE|{args.new_tab}" + event_system.send_ipc_message(message) def tear_down(self, widget=None, eve=None):