clean up ending whitespaces

This commit is contained in:
chrys87 2018-03-12 10:39:57 +01:00 committed by GitHub
parent 2f15dc945b
commit d797c16cb4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,7 +6,7 @@
from core import debug from core import debug
from utils import line_utils from utils import line_utils
import string, time import string, time, re
class outputManager(): class outputManager():
def __init__(self): def __init__(self):
@ -92,11 +92,12 @@ class outputManager():
self.env['runtime']['debug'].writeDebugOut(str(e),debug.debugLevel.ERROR) self.env['runtime']['debug'].writeDebugOut(str(e),debug.debugLevel.ERROR)
try: try:
text = self.env['runtime']['headLineManager'].replaceHeadLines(text) cleanText = text.replace('\n',' , ')
text = self.env['runtime']['punctuationManager'].proceedPunctuation(text,ignorePunctuation) cleanText = re.sub(' +$',' ', cleanText)
text = text.replace('\n',' , ') cleanText = self.env['runtime']['headLineManager'].replaceHeadLines(cleanText)
self.env['runtime']['speechDriver'].speak(text) cleanText = self.env['runtime']['punctuationManager'].proceedPunctuation(cleanText, ignorePunctuation)
self.env['runtime']['debug'].writeDebugOut("Speak: "+ text,debug.debugLevel.INFO) self.env['runtime']['speechDriver'].speak(cleanText)
self.env['runtime']['debug'].writeDebugOut("Speak: "+ cleanText,debug.debugLevel.INFO)
except Exception as e: except Exception as e:
self.env['runtime']['debug'].writeDebugOut("\"speak\" in outputManager.speakText ",debug.debugLevel.ERROR) self.env['runtime']['debug'].writeDebugOut("\"speak\" in outputManager.speakText ",debug.debugLevel.ERROR)
self.env['runtime']['debug'].writeDebugOut(str(e),debug.debugLevel.ERROR) self.env['runtime']['debug'].writeDebugOut(str(e),debug.debugLevel.ERROR)