From d5fa50e8c318ca54c850912f598bb3f852e40fed Mon Sep 17 00:00:00 2001 From: chrys Date: Wed, 5 Sep 2018 19:13:20 +0200 Subject: [PATCH] add handler functio --- src/fenrirscreenreader/core/eventManager.py | 4 +++- src/fenrirscreenreader/core/fenrirManager.py | 4 ++++ src/fenrirscreenreader/core/remoteManager.py | 6 ++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/fenrirscreenreader/core/eventManager.py b/src/fenrirscreenreader/core/eventManager.py index 10c7c698..82e55b7c 100644 --- a/src/fenrirscreenreader/core/eventManager.py +++ b/src/fenrirscreenreader/core/eventManager.py @@ -55,7 +55,9 @@ class eventManager(): elif event['Type'] == fenrirEventType.ExecuteCommand: self.env['runtime']['fenrirManager'].handleExecuteCommand(event) elif event['Type'] == fenrirEventType.ByteInput: - self.env['runtime']['fenrirManager'].handleByteInput(event) + self.env['runtime']['fenrirManager'].handleByteInput(event) + elif event['Type'] == fenrirEventType.RemoteIncomming: + self.env['runtime']['fenrirManager'].handleRemoteIncomming(event) def isMainEventLoopRunning(self): return self.running.value == 1 def startMainEventLoop(self): diff --git a/src/fenrirscreenreader/core/fenrirManager.py b/src/fenrirscreenreader/core/fenrirManager.py index e757da1a..b9dbe67b 100644 --- a/src/fenrirscreenreader/core/fenrirManager.py +++ b/src/fenrirscreenreader/core/fenrirManager.py @@ -105,6 +105,10 @@ class fenrirManager(): self.environment['runtime']['commandManager'].executeCommand( command, 'help') return self.environment['runtime']['commandManager'].executeCommand( command, 'commands') + def handleRemoteIncomming(self, event): + if not event['Data']: + return + self.environment['runtime']['remoteManager'].handleRemoteIncomming(event['Data']) def handleScreenChange(self, event): self.environment['runtime']['screenManager'].hanldeScreenChange(event['Data']) ''' diff --git a/src/fenrirscreenreader/core/remoteManager.py b/src/fenrirscreenreader/core/remoteManager.py index c9600d90..e6ef192f 100644 --- a/src/fenrirscreenreader/core/remoteManager.py +++ b/src/fenrirscreenreader/core/remoteManager.py @@ -5,6 +5,7 @@ # By Chrys, Storm Dragon, and contributers. from fenrirscreenreader.core import debug +from fenrirscreenreader.core.eventData import fenrirEventType class remoteManager(): def __init__(self): @@ -13,3 +14,8 @@ class remoteManager(): self.env = environment def shutdown(self): pass + def unixSocketWatchDog(): + pass + def handleRemoteIncomming(self, eventData): + if not eventData: + return