Update linux.py
This commit is contained in:
parent
7fe6dedb6f
commit
e916a84ee1
@ -28,8 +28,11 @@ class driver():
|
|||||||
currScreenFile.close()
|
currScreenFile.close()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.env['runtime']['debug'].writeDebugOut(str(e),debug.debugLevel.ERROR)
|
self.env['runtime']['debug'].writeDebugOut(str(e),debug.debugLevel.ERROR)
|
||||||
def injectTextToScreen(self, text):
|
def injectTextToScreen(self, text, screen = None):
|
||||||
with open("/dev/tty" + self.env['screenData']['newTTY'], 'w') as fd:
|
useScreen = "/dev/tty" + self.env['screenData']['newTTY']
|
||||||
|
if screen != None:
|
||||||
|
useScreen = screen
|
||||||
|
with open(useScreen, 'w') as fd:
|
||||||
for c in text:
|
for c in text:
|
||||||
fcntl.ioctl(fd, termios.TIOCSTI, c)
|
fcntl.ioctl(fd, termios.TIOCSTI, c)
|
||||||
time.sleep(0.005)
|
time.sleep(0.005)
|
||||||
|
Loading…
Reference in New Issue
Block a user