From c90c726899ee42f85e47f44a4296e35e54dfa339 Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Sat, 5 Jul 2025 09:15:40 -0400 Subject: [PATCH] Fixed a bug in the remote manager. --- src/fenrir | 13 +++++++++++-- .../commands/commands/subprocess.py | 12 ++++++------ src/fenrirscreenreader/core/fenrirManager.py | 2 +- src/fenrirscreenreader/fenrirVersion.py | 2 +- 4 files changed, 19 insertions(+), 10 deletions(-) diff --git a/src/fenrir b/src/fenrir index 67f58e62..11f332fd 100755 --- a/src/fenrir +++ b/src/fenrir @@ -95,8 +95,17 @@ def validate_arguments(cliArgs): def run_fenrir(): """Main function that runs Fenrir""" fenrirApp = fenrirManager.FenrirManager(cliArgs) - fenrirApp.proceed() - del fenrirApp + try: + fenrirApp.proceed() + finally: + del fenrirApp + # Clean up PID file if it exists + pidFile = "/run/fenrir.pid" + if os.path.exists(pidFile): + try: + os.remove(pidFile) + except Exception: + pass def main(): global cliArgs diff --git a/src/fenrirscreenreader/commands/commands/subprocess.py b/src/fenrirscreenreader/commands/commands/subprocess.py index 37f32cff..f38f3d46 100644 --- a/src/fenrirscreenreader/commands/commands/subprocess.py +++ b/src/fenrirscreenreader/commands/commands/subprocess.py @@ -30,15 +30,15 @@ class command(): def run(self): if not os.path.exists(self.script_path): self.env['runtime']['OutputManager'].present_text( - _('Script file not found'), sound_icon ='', interrupt=False) + _('Script file not found'), sound_icon='', interrupt=False) return if not os.path.isfile(self.script_path): self.env['runtime']['OutputManager'].present_text( - _('Script source is not a valid file'), sound_icon ='', interrupt=False) + _('Script source is not a valid file'), sound_icon='', interrupt=False) return if not os.access(self.script_path, os.X_OK): self.env['runtime']['OutputManager'].present_text( - _('Script file is not executable'), sound_icon ='', interrupt=False) + _('Script file is not executable'), sound_icon='', interrupt=False) return _thread.start_new_thread(self._thread_run, ()) @@ -53,13 +53,13 @@ class command(): self.env['runtime']['OutputManager'].interrupt_output() if stderr != '': self.env['runtime']['OutputManager'].present_text( - str(stderr), sound_icon ='', interrupt=False) + str(stderr), sound_icon='', interrupt=False) if stdout != '': self.env['runtime']['OutputManager'].present_text( - str(stdout), sound_icon ='', interrupt=False) + str(stdout), sound_icon='', interrupt=False) except Exception as e: self.env['runtime']['OutputManager'].present_text( - e, sound_icon ='', interrupt=False) + str(e), sound_icon='', interrupt=False) def set_callback(self, callback): pass diff --git a/src/fenrirscreenreader/core/fenrirManager.py b/src/fenrirscreenreader/core/fenrirManager.py index 65c9c366..c350106d 100644 --- a/src/fenrirscreenreader/core/fenrirManager.py +++ b/src/fenrirscreenreader/core/fenrirManager.py @@ -128,7 +128,7 @@ class FenrirManager(): def handle_remote_incomming(self, event): if not event['data']: return - self.environment['runtime']['remoteManager'].handle_remote_incomming( + self.environment['runtime']['RemoteManager'].handle_remote_incomming( event['data']) def handle_screen_change(self, event): diff --git a/src/fenrirscreenreader/fenrirVersion.py b/src/fenrirscreenreader/fenrirVersion.py index 5499505f..d17ef149 100644 --- a/src/fenrirscreenreader/fenrirVersion.py +++ b/src/fenrirscreenreader/fenrirVersion.py @@ -4,6 +4,6 @@ # Fenrir TTY screen reader # By Chrys, Storm Dragon, and contributers. -version = "2025.07.03" +version = "2025.07.05" codeName = "testing" code_name = "testing"