clean up output

This commit is contained in:
chrys 2016-07-07 01:51:54 +02:00
parent 1e93905a23
commit d745d8a9c0

View File

@ -46,7 +46,6 @@ while(runtime['running']):
runtime['newContentBytes'] = vcsa.read() runtime['newContentBytes'] = vcsa.read()
vcsa.close() vcsa.close()
except: except:
print('Nope' + runtime['screenDriver'] + runtime['newTTY'])
continue continue
# get metadata like cursor or screensize # get metadata like cursor or screensize
@ -70,12 +69,8 @@ while(runtime['running']):
if runtime['oldContentBytes'] != runtime['newContentBytes']: if runtime['oldContentBytes'] != runtime['newContentBytes']:
if len(runtime['delta']) < 3: if len(runtime['delta']) < 3:
runtime['speechDriver'].cancel() runtime['speechDriver'].cancel()
print(len(runtime['delta']))
print("tty3 changed")
print(runtime['delta'])
diff = difflib.ndiff(runtime['oldContentText'], runtime['newContentText']) diff = difflib.ndiff(runtime['oldContentText'], runtime['newContentText'])
runtime['delta'] = ''.join(x[2:] for x in diff if x.startswith('+ ')) runtime['delta'] = ''.join(x[2:] for x in diff if x.startswith('+ '))
print(runtime['delta'])
runtime['speechDriver'].speak(runtime['delta']) runtime['speechDriver'].speak(runtime['delta'])
# set new "old" values # set new "old" values