more modernizing commands
This commit is contained in:
parent
2aaa242479
commit
cdc86fdad1
@ -17,9 +17,7 @@ class command():
|
|||||||
return
|
return
|
||||||
if environment['screenData']['newTTY'] != environment['screenData']['oldTTY']:
|
if environment['screenData']['newTTY'] != environment['screenData']['oldTTY']:
|
||||||
return
|
return
|
||||||
# if environment['screenData']['newCursor'] == environment['screenData']['oldCursor'] and\
|
|
||||||
# environment['screenData']['newDelta'] == environment['screenData']['oldDelta']:
|
|
||||||
# return environment
|
|
||||||
environment['runtime']['outputManager'].interruptOutput(environment)
|
environment['runtime']['outputManager'].interruptOutput(environment)
|
||||||
|
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
|
@ -25,12 +25,9 @@ class command():
|
|||||||
if environment['screenData']['newCursor']['y'] != environment['screenData']['oldCursor']['y'] or\
|
if environment['screenData']['newCursor']['y'] != environment['screenData']['oldCursor']['y'] or\
|
||||||
environment['screenData']['newCursor']['x'] == environment['screenData']['oldCursor']['x']:
|
environment['screenData']['newCursor']['x'] == environment['screenData']['oldCursor']['x']:
|
||||||
return
|
return
|
||||||
print('drin')
|
currChar = environment['screenData']['newContentText'].split('\n')[environment['screenData']['newCursor']['y']][environment['screenData']['newCursor']['x']]
|
||||||
if environment['screenData']['newContentText'].split('\n')[environment['screenData']['newCursor']['y']][environment['screenData']['newCursor']['x']].strip() == '':
|
if not currChar.strip(" \t\n") == '':
|
||||||
pass
|
environment['runtime']['outputManager'].presentText(environment, currChar, interrupt=True)
|
||||||
#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)
|
|
||||||
|
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
@ -12,15 +12,16 @@ class command():
|
|||||||
|
|
||||||
def run(self, environment):
|
def run(self, environment):
|
||||||
if environment['screenData']['newTTY'] != environment['screenData']['oldTTY']:
|
if environment['screenData']['newTTY'] != environment['screenData']['oldTTY']:
|
||||||
return environment
|
return
|
||||||
if environment['screenData']['newDelta'] != environment['screenData']['oldDelta']:
|
if environment['screenData']['newDelta'] != environment['screenData']['oldDelta']:
|
||||||
return environment
|
return
|
||||||
if environment['screenData']['newCursor']['y'] == environment['screenData']['oldCursor']['y']:
|
if environment['screenData']['newCursor']['y'] == environment['screenData']['oldCursor']['y']:
|
||||||
return environment
|
return
|
||||||
if environment['screenData']['newContentText'].split('\n')[environment['screenData']['newCursor']['y']].strip(" \t\n") == '':
|
currLine = environment['screenData']['newContentText'].split('\n')[environment['screenData']['newCursor']['y']]
|
||||||
|
if currLine.strip(" \t\n") == '':
|
||||||
environment['runtime']['outputManager'].presentText(environment, "blank", soundIcon='EmptyLine', interrupt=True)
|
environment['runtime']['outputManager'].presentText(environment, "blank", soundIcon='EmptyLine', interrupt=True)
|
||||||
else:
|
else:
|
||||||
environment['runtime']['outputManager'].presentText(environment, environment['screenData']['newContentText'].split('\n')[environment['screenData']['newCursor']['y']], True)
|
environment['runtime']['outputManager'].presentText(environment, currLine, interrupt=True)
|
||||||
|
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
@ -21,7 +21,7 @@ class command():
|
|||||||
|
|
||||||
# for now no new line
|
# for now no new line
|
||||||
if environment['screenData']['newCursor']['y'] != environment['screenData']['oldCursor']['y']:
|
if environment['screenData']['newCursor']['y'] != environment['screenData']['oldCursor']['y']:
|
||||||
return environment
|
return
|
||||||
if len(environment['screenData']['newDelta']) > 1:
|
if len(environment['screenData']['newDelta']) > 1:
|
||||||
return
|
return
|
||||||
|
|
||||||
@ -38,11 +38,11 @@ class command():
|
|||||||
x, y, currWord = word_utils.getCurrentWord(environment['screenData']['newCursor']['x'], 0, newContent)
|
x, y, currWord = word_utils.getCurrentWord(environment['screenData']['newCursor']['x'], 0, newContent)
|
||||||
# was this a typed word?
|
# was this a typed word?
|
||||||
if environment['screenData']['newDelta'] != '':
|
if environment['screenData']['newDelta'] != '':
|
||||||
if not(newContent[environment['screenData']['oldCursor']['x']].strip() == '' and x != environment['screenData']['oldCursor']['x']):
|
if not(newContent[environment['screenData']['oldCursor']['x']].strip(" \t\n") == '' and x != environment['screenData']['oldCursor']['x']):
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
# or just arrow arround?
|
# or just arrow arround?
|
||||||
if not(newContent[environment['screenData']['newCursor']['x']].strip() == '' and x != environment['screenData']['newCursor']['x']):
|
if not(newContent[environment['screenData']['newCursor']['x']].strip(" \t\n") == '' and x != environment['screenData']['newCursor']['x']):
|
||||||
return
|
return
|
||||||
|
|
||||||
if currWord != '':
|
if currWord != '':
|
||||||
|
@ -54,11 +54,11 @@ class command():
|
|||||||
x, y, currWord = word_utils.getCurrentWord(environment['screenData']['newCursor']['x'], 0, newContent)
|
x, y, currWord = word_utils.getCurrentWord(environment['screenData']['newCursor']['x'], 0, newContent)
|
||||||
# was this a typed word?
|
# was this a typed word?
|
||||||
if environment['screenData']['newDelta'] != '':
|
if environment['screenData']['newDelta'] != '':
|
||||||
if not(newContent[environment['screenData']['oldCursor']['x']].strip() == '' and x != environment['screenData']['oldCursor']['x']):
|
if not(newContent[environment['screenData']['oldCursor']['x']].strip(" \t\n") == '' and x != environment['screenData']['oldCursor']['x']):
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
# or just arrow arround?
|
# or just arrow arround?
|
||||||
if not(newContent[environment['screenData']['newCursor']['x']].strip() == '' and x != environment['screenData']['newCursor']['x']):
|
if not(newContent[environment['screenData']['newCursor']['x']].strip(" \t\n") == '' and x != environment['screenData']['newCursor']['x']):
|
||||||
return
|
return
|
||||||
|
|
||||||
if currWord != '':
|
if currWord != '':
|
||||||
|
@ -14,6 +14,8 @@ class command():
|
|||||||
def run(self, environment):
|
def run(self, environment):
|
||||||
if not environment['runtime']['settingsManager'].getSettingAsBool(environment, 'promote', 'enabled'):
|
if not environment['runtime']['settingsManager'].getSettingAsBool(environment, 'promote', 'enabled'):
|
||||||
return
|
return
|
||||||
|
if environment['runtime']['settingsManager'].getSetting(environment, 'promote', 'list').strip(" \t\n") == '':
|
||||||
|
return
|
||||||
if environment['screenData']['newTTY'] != environment['screenData']['oldTTY']:
|
if environment['screenData']['newTTY'] != environment['screenData']['oldTTY']:
|
||||||
return
|
return
|
||||||
if environment['screenData']['newDelta'] == '':
|
if environment['screenData']['newDelta'] == '':
|
||||||
|
Loading…
Reference in New Issue
Block a user