From f01583b13cd1212a0d195ce4d5d48c2f501f0d66 Mon Sep 17 00:00:00 2001 From: chrys Date: Sun, 25 Mar 2018 15:54:12 +0200 Subject: [PATCH] sync --- TODO v2.0 | 2 +- src/fenrirscreenreader/core/settingsManager.py | 10 +++++----- src/fenrirscreenreader/screenDriver/ptyDriver.py | 11 ++++++----- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/TODO v2.0 b/TODO v2.0 index 6696ebaa..8cac3e41 100644 --- a/TODO v2.0 +++ b/TODO v2.0 @@ -77,7 +77,7 @@ Driver (screen, input): [X] detect colum/ lines [X] resize on colum / line change [W] make shell command configurable (or detect it) - [W] stop emulation properly + [X] stop emulation properly [] make pasteing text work again https://docs.python.org/3.2/library/pty.html http://sqizit.bartletts.id.au/2011/02/14/pseudo-terminals-in-python/ diff --git a/src/fenrirscreenreader/core/settingsManager.py b/src/fenrirscreenreader/core/settingsManager.py index eab21370..70b3850e 100644 --- a/src/fenrirscreenreader/core/settingsManager.py +++ b/src/fenrirscreenreader/core/settingsManager.py @@ -334,13 +334,13 @@ class settingsManager(): environment['runtime']['eventManager'] = eventManager.eventManager() environment['runtime']['eventManager'].initialize(environment) environment['runtime']['processManager'] = processManager.processManager() - environment['runtime']['processManager'].initialize(environment) + environment['runtime']['processManager'].initialize(environment) + environment['runtime']['commandManager'] = commandManager.commandManager() + environment['runtime']['commandManager'].initialize(environment) + environment['runtime']['inputManager'] = inputManager.inputManager() + environment['runtime']['inputManager'].initialize(environment) environment['runtime']['outputManager'] = outputManager.outputManager() environment['runtime']['outputManager'].initialize(environment) - environment['runtime']['commandManager'] = commandManager.commandManager() - environment['runtime']['commandManager'].initialize(environment) - environment['runtime']['inputManager'] = inputManager.inputManager() - environment['runtime']['inputManager'].initialize(environment) environment['runtime']['punctuationManager'] = punctuationManager.punctuationManager() environment['runtime']['punctuationManager'].initialize(environment) environment['runtime']['cursorManager'] = cursorManager.cursorManager() diff --git a/src/fenrirscreenreader/screenDriver/ptyDriver.py b/src/fenrirscreenreader/screenDriver/ptyDriver.py index 7c0aa075..ef52985a 100644 --- a/src/fenrirscreenreader/screenDriver/ptyDriver.py +++ b/src/fenrirscreenreader/screenDriver/ptyDriver.py @@ -4,7 +4,7 @@ # Fenrir TTY screen reader # By Chrys, Storm Dragon, and contributers. -import os, struct, sys, pty, tty, termios, shlex, signal, select, pyte, time, fcntl +import os, struct, sys, pty, tty, termios, shlex, signal, select, pyte, time, fcntl ,getpass from fenrirscreenreader.core import debug from fenrirscreenreader.core.eventData import fenrirEventType from fenrirscreenreader.core.screenDriver import screenDriver @@ -62,13 +62,14 @@ class driver(screenDriver): self.env['screen']['oldTTY'] = '1' self.env['screen']['newTTY'] = '1' - def injectTextToScreen(self, text, screen = None): + def injectTextToScreen(self, msgBytes, screen = None): + #os.write(p_out.fileno(), msgBytes) pass def getSessionInformation(self): self.env['screen']['autoIgnoreScreens'] = [] - self.env['general']['prevUser'] = 'chrys' - self.env['general']['currUser'] = 'chrys' + self.env['general']['prevUser'] = getpass.getuser() + self.env['general']['currUser'] = getpass.getuser() def readAll(self,fd): bytes = os.read(fd, 65536) if bytes == b'': @@ -114,7 +115,7 @@ class driver(screenDriver): terminal, p_pid, p_out = self.openTerminal(columns, lines) std_out = os.fdopen(sys.stdout.fileno(), "w+b", 0) - while active: + while active.value: r, w, x = select.select([sys.stdin, p_out, self.signalPipe[0]],[],[],1) # none if r == []: