From 73338931bd89b8f8a4e22d4ea73648150e6b677b Mon Sep 17 00:00:00 2001 From: chrys Date: Fri, 15 Jul 2016 00:08:08 +0200 Subject: [PATCH] improve review commands --- src/fenrir-package/commands/commands/curr_line.py | 2 +- src/fenrir-package/commands/commands/next_line.py | 2 +- src/fenrir-package/commands/commands/prev_line.py | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/fenrir-package/commands/commands/curr_line.py b/src/fenrir-package/commands/commands/curr_line.py index 9382c291..4a4e90fc 100644 --- a/src/fenrir-package/commands/commands/curr_line.py +++ b/src/fenrir-package/commands/commands/curr_line.py @@ -8,7 +8,7 @@ class command(): if environment['screenData']['newCursorReview']['y'] == -1: environment['screenData']['newCursorReview'] = environment['screenData']['newCursor'].copy() - if environment['screenData']['newContentText'].replace(" ","") == '': + if environment['screenData']['newContentText'].split('\n')[environment['screenData']['newCursorReview']['y']].replace(" ","").replace("\n","").replace("\t","") == '': environment['runtime']['outputManager'].speakText(environment, "empty line") else: environment['runtime']['outputManager'].speakText(environment, environment['screenData']['newContentText'].split('\n')[environment['screenData']['newCursorReview']['y']]) diff --git a/src/fenrir-package/commands/commands/next_line.py b/src/fenrir-package/commands/commands/next_line.py index c618c0f6..165b43ae 100644 --- a/src/fenrir-package/commands/commands/next_line.py +++ b/src/fenrir-package/commands/commands/next_line.py @@ -10,7 +10,7 @@ class command(): if environment['screenData']['newCursorReview']['y'] + 1 < environment['screenData']['lines']: environment['screenData']['newCursorReview']['y'] = environment['screenData']['newCursorReview']['y'] + 1 - if environment['screenData']['newContentText'].replace(" ","") == '': + if environment['screenData']['newContentText'].split('\n')[environment['screenData']['newCursorReview']['y']].replace(" ","").replace("\n","").replace("\t","") == '': environment['runtime']['outputManager'].speakText(environment, "empty line") else: environment['runtime']['outputManager'].speakText(environment, environment['screenData']['newContentText'].split('\n')[environment['screenData']['newCursorReview']['y']]) diff --git a/src/fenrir-package/commands/commands/prev_line.py b/src/fenrir-package/commands/commands/prev_line.py index aeeef62b..ba5e3e6a 100644 --- a/src/fenrir-package/commands/commands/prev_line.py +++ b/src/fenrir-package/commands/commands/prev_line.py @@ -9,8 +9,7 @@ class command(): environment['screenData']['newCursorReview'] = environment['screenData']['newCursor'].copy() if environment['screenData']['newCursorReview']['y'] - 1 >= 0: environment['screenData']['newCursorReview']['y'] = environment['screenData']['newCursorReview']['y'] - 1 - - if environment['screenData']['newContentText'].replace(" ","") == '': + if environment['screenData']['newContentText'].split('\n')[environment['screenData']['newCursorReview']['y']].replace(" ","").replace("\n","").replace("\t","") == '': environment['runtime']['outputManager'].speakText(environment, "empty line") else: environment['runtime']['outputManager'].speakText(environment, environment['screenData']['newContentText'].split('\n')[environment['screenData']['newCursorReview']['y']])