polish clipboard stuff

This commit is contained in:
chrys
2016-08-24 00:41:16 +02:00
parent 3f869b65ed
commit eb323eeedf
10 changed files with 36 additions and 67 deletions

View File

@ -5,14 +5,16 @@ class command():
def __init__(self):
pass
def run(self, environment):
print('run')
if (environment['commandBuffer']['Marks']['1'] == None) or \
(environment['commandBuffer']['Marks']['2'] == None):
environment['runtime']['outputManager'].presentText(environment, "two marks needed", interrupt=True)
return environment
marked = mark_utils.getTextBetweenMarks(environment['commandBuffer']['Marks']['1'], environment['commandBuffer']['Marks']['2'], environment['screenData']['newContentText'].split('\n'))
environment['commandBuffer']['clipboard'] = [marked] + environment['commandBuffer']['clipboard'][:9]
environment['commandBuffer']['clipboard'] = 0
environment['commandBuffer']['currClipboard'] = 0
if marked.strip(" \t\n") == '':
environment['runtime']['outputManager'].presentText(environment, "blank", soundIcon='EmptyLine', interrupt=True)

View File

@ -11,7 +11,7 @@ class command():
return environment
marked = mark_utils.getTextBetweenMarks(environment['commandBuffer']['Marks']['1'], environment['commandBuffer']['Marks']['2'], environment['screenData']['newContentText'].split('\n'))
print(marked)
if marked.strip(" \t\n") == '':
environment['runtime']['outputManager'].presentText(environment, "blank", soundIcon='EmptyLine', interrupt=True)
else:

View File

@ -6,14 +6,16 @@ class command():
def run(self, environment):
if environment['screenData']['newCursorReview'] == None:
environment['runtime']['outputManager'].presentText(environment, 'no review cursor', interrupt=True)
return environment
if environment['commandBuffer']['Marks']['1'] == None:
environment['commandBuffer']['Marks']['1'] = environment['screenData']['newCursorReview']
environment['commandBuffer']['Marks']['1'] = environment['screenData']['newCursorReview'].copy()
else:
environment['commandBuffer']['Marks']['2'] = environment['screenData']['newCursorReview']
environment['commandBuffer']['Marks']['2'] = environment['screenData']['newCursorReview'].copy()
environment['runtime']['outputManager'].presentText(environment, 'set mark', interrupt=True)
return environment
return environment
def setCallback(self, callback):
pass
def shutdown(self):