From 357ab61aa041c7d89472a36ab6d140a40202c700 Mon Sep 17 00:00:00 2001 From: chrys87 Date: Thu, 25 Aug 2016 10:54:46 +0200 Subject: [PATCH] Create curr_screen_after_cursor.py --- .../commands/curr_screen_after_cursor.py | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/fenrir-package/commands/commands/curr_screen_after_cursor.py diff --git a/src/fenrir-package/commands/commands/curr_screen_after_cursor.py b/src/fenrir-package/commands/commands/curr_screen_after_cursor.py new file mode 100644 index 00000000..9dc3f779 --- /dev/null +++ b/src/fenrir-package/commands/commands/curr_screen_after_cursor.py @@ -0,0 +1,25 @@ +#!/bin/python + +from utils import mark_utils + +class command(): + def __init__(self): + pass + def run(self, environment): + # Prefer review cursor over text cursor + if (environment['screenData']['newCursorReview'] != None) + cursorPos = environment['screenData']['newCursorReview'].copy() + else: + cursorPos = environment['screenData']['newCursor'].copy() + + textAfterCursor = mark_utils.getTextAfterMark(cursorPos, environment['screenData']['newContentText']) + + if textAfterCursor.strip() == '': + environment['runtime']['outputManager'].presentText(environment, "blank", soundIcon='EmptyLine', interrupt=True) + else: + environment['runtime']['outputManager'].presentText(environment, textAfterCursor, interrupt=True) + return environment + def setCallback(self, callback): + pass + def shutdown(self): + pass