polish auto output

This commit is contained in:
chrys
2016-08-07 17:00:54 +02:00
parent 590623b61d
commit cebfb6797c
7 changed files with 190 additions and 0 deletions

View File

@ -0,0 +1,28 @@
#!/bin/python
import time
class command():
def __init__(self):
pass
def run(self, environment):
# TTY Change
if environment['screenData']['newTTY'] != environment['screenData']['oldTTY']:
return environment
# detect an change on the screen, we just want to cursor arround, so no change should appear
if environment['screenData']['newDelta'] != '':
return environment
# is it a horizontal change?
if environment['screenData']['newCursor']['y'] != environment['screenData']['oldCursor']['y'] or\
environment['screenData']['newCursor']['x'] == environment['screenData']['oldCursor']['x']:
return environment
if environment['screenData']['newContentText'].split('\n')[environment['screenData']['newCursor']['y']][environment['screenData']['newCursor']['x']].strip(" \t\n") == '':
pass
#environment['runtime']['outputManager'].presentText(environment, "blank",True)
else:
environment['runtime']['outputManager'].presentText(environment, environment['screenData']['newContentText'].split('\n')[environment['screenData']['newCursor']['y']][environment['screenData']['newCursor']['x']],interrupt=True)
return environment
def setCallback(self, callback):
pass
def shutdown(self):
pass

View File

@ -0,0 +1,21 @@
#!/bin/python
class command():
def __init__(self):
pass
def run(self, environment):
if environment['screenData']['newTTY'] != environment['screenData']['oldTTY']:
return environment
if environment['screenData']['newDelta'] != environment['screenData']['oldDelta']:
return environment
if environment['screenData']['newCursor']['y'] == environment['screenData']['oldCursor']['y']:
return environment
if environment['screenData']['newContentText'].split('\n')[environment['screenData']['newCursor']['y']].strip(" \t\n") == '':
environment['runtime']['outputManager'].presentText(environment, "blank", soundIconName='EmptyLine', interrupt=True)
else:
environment['runtime']['outputManager'].presentText(environment, environment['screenData']['newContentText'].split('\n')[environment['screenData']['newCursor']['y']], True)
return environment
def setCallback(self, callback):
pass
def shutdown(self):
pass