Update copy_marked_to_clipboard.py

This commit is contained in:
chrys87 2016-08-25 10:43:35 +02:00 committed by GitHub
parent 557dfb3f10
commit 370ce2fe0b

View File

@ -1,13 +1,11 @@
#!/bin/python #!/bin/python
try:
from utils import mark_utils from utils import mark_utils
except Exception as e:
print(e)
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def run(self, environment): def run(self, environment):
if (environment['commandBuffer']['Marks']['1'] == None) or \ if (environment['commandBuffer']['Marks']['1'] == None) or \
(environment['commandBuffer']['Marks']['2'] == None): (environment['commandBuffer']['Marks']['2'] == None):
environment['runtime']['outputManager'].presentText(environment, "two marks needed", interrupt=True) environment['runtime']['outputManager'].presentText(environment, "two marks needed", interrupt=True)
@ -23,6 +21,7 @@ class command():
environment['commandBuffer']['clipboard'] = [marked] + environment['commandBuffer']['clipboard'][:environment['runtime']['settingsManager'].getSettingAsFloat(environment, 'general', 'numberOfClipboards') -1] environment['commandBuffer']['clipboard'] = [marked] + environment['commandBuffer']['clipboard'][:environment['runtime']['settingsManager'].getSettingAsFloat(environment, 'general', 'numberOfClipboards') -1]
environment['commandBuffer']['currClipboard'] = 0 environment['commandBuffer']['currClipboard'] = 0
# reset marks
environment['commandBuffer']['Marks']['1'] = None environment['commandBuffer']['Marks']['1'] = None
environment['commandBuffer']['Marks']['2'] = None environment['commandBuffer']['Marks']['2'] = None
environment['commandBuffer']['Marks']['3'] = None environment['commandBuffer']['Marks']['3'] = None