From 4d265595c6fdca1d23046ebd04dc0de887d6bb47 Mon Sep 17 00:00:00 2001 From: chrys Date: Wed, 21 Mar 2018 21:52:33 +0100 Subject: [PATCH] add debug --- src/fenrir/commands/onScreenUpdate/70000-incoming.py | 12 ++++++------ src/fenrir/screenDriver/vcsaDriver.py | 6 +++++- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/fenrir/commands/onScreenUpdate/70000-incoming.py b/src/fenrir/commands/onScreenUpdate/70000-incoming.py index 1e2840e1..58f37b94 100644 --- a/src/fenrir/commands/onScreenUpdate/70000-incoming.py +++ b/src/fenrir/commands/onScreenUpdate/70000-incoming.py @@ -26,12 +26,12 @@ class command(): #if len(self.env['screen']['newDelta'].strip(' \n\t')) <= 1: xMove = abs(self.env['screen']['newCursor']['x'] - self.env['screen']['oldCursor']['x']) yMove = abs(self.env['screen']['newCursor']['y'] - self.env['screen']['oldCursor']['y']) - self.env['runtime']['debug'].writeDebugOut('newX:' + str(self.env['screen']['newCursor']['x']) + 'oldX:' + str(self.env['screen']['oldCursor']['x']),debug.debugLevel.INFO) - self.env['runtime']['debug'].writeDebugOut('newY:' + str(self.env['screen']['newCursor']['y']) + 'oldY:' + str(self.env['screen']['oldCursor']['y']),debug.debugLevel.INFO) - self.env['runtime']['debug'].writeDebugOut('xMove:'+ str(xMove)+' yMove:'+str(yMove),debug.debugLevel.INFO) - self.env['runtime']['debug'].writeDebugOut('NewDeltaLen:'+str(len(self.env['screen']['newDelta'])),debug.debugLevel.INFO) - self.env['runtime']['debug'].writeDebugOut(str(self.env['screen']),debug.debugLevel.INFO) - + #self.env['runtime']['debug'].writeDebugOut('newX:' + str(self.env['screen']['newCursor']['x']) + 'oldX:' + str(self.env['screen']['oldCursor']['x']),debug.debugLevel.INFO) + #self.env['runtime']['debug'].writeDebugOut('newY:' + str(self.env['screen']['newCursor']['y']) + 'oldY:' + str(self.env['screen']['oldCursor']['y']),debug.debugLevel.INFO) + #self.env['runtime']['debug'].writeDebugOut('xMove:'+ str(xMove)+' yMove:'+str(yMove),debug.debugLevel.INFO) + #self.env['runtime']['debug'].writeDebugOut('NewDeltaLen:'+str(len(self.env['screen']['newDelta'])),debug.debugLevel.INFO) + #self.env['runtime']['debug'].writeDebugOut(str(self.env['screen']),debug.debugLevel.INFO) + self.env['runtime']['debug'].writeDebugOut('NewDelta:'+str(self.env['screen']['newDelta']),debug.debugLevel.INFO) if (xMove >= 1) and xMove == len(self.env['screen']['newDelta']): # if len(self.env['screen']['newDelta'].strip(' \n\t0123456789')) <= 2: return diff --git a/src/fenrir/screenDriver/vcsaDriver.py b/src/fenrir/screenDriver/vcsaDriver.py index 25ca4680..22d13cb3 100644 --- a/src/fenrir/screenDriver/vcsaDriver.py +++ b/src/fenrir/screenDriver/vcsaDriver.py @@ -340,6 +340,8 @@ class driver(screenDriver): if oldScreenText == '' and\ newScreenText != '': self.env['screen']['newDelta'] = newScreenText + self.env['runtime']['debug'].writeDebugOut('VCSA 1',debug.debugLevel.INFO) + else: cursorLineStart = self.env['screen']['newCursor']['y'] * self.env['screen']['columns'] + self.env['screen']['newCursor']['y'] cursorLineEnd = cursorLineStart + self.env['screen']['columns'] @@ -363,16 +365,18 @@ class driver(screenDriver): if tempNewDelta.strip() != '': if tempNewDelta != ''.join(newScreenText[self.env['screen']['oldCursor']['x']:self.env['screen']['newCursor']['x']].rstrip()): diffList = ['+ ' + self.env['screen']['newContentText'].split('\n')[self.env['screen']['newCursor']['y']]] - + self.env['runtime']['debug'].writeDebugOut('VCSA 2',debug.debugLevel.INFO) typing = True else: diff = difflib.ndiff( oldScreenText.split('\n'),\ newScreenText.split('\n')) diffList = list(diff) + self.env['runtime']['debug'].writeDebugOut('VCSA 3',debug.debugLevel.INFO) if self.env['runtime']['settingsManager'].getSetting('general', 'newLinePause') and not typing: self.env['screen']['newDelta'] = '\n'.join(x[2:] for x in diffList if x[0] == '+') + self.env['runtime']['debug'].writeDebugOut('VCSA whoops' + str(typing),debug.debugLevel.INFO) else: self.env['screen']['newDelta'] = ''.join(x[2:] for x in diffList if x[0] == '+') self.env['screen']['newNegativeDelta'] = ''.join(x[2:] for x in diffList if x[0] == '-')