debug trash

This commit is contained in:
chrys 2016-08-30 22:52:54 +02:00
parent 0c6deec6d6
commit b4dd3e7675
4 changed files with 10 additions and 9 deletions

View File

@ -42,7 +42,7 @@ class inputManager():
except:
pass
except Exception as e:
environment['runtime']['debug'].writeDebugOut(environment,str(e),0)
environment['runtime']['debug'].writeDebugOut(environment,str(e),debug.debugLevel.ERROR)
self.freeDevices()
time.sleep(0.01)
environment['input']['currShortcutString'] = self.getShortcutString(environment)

View File

@ -11,6 +11,7 @@ if not os.getcwd() in sys.path:
from core import environment
from core import settingsManager
from utils import debug
class fenrir():
def __init__(self):
@ -22,7 +23,7 @@ class fenrir():
#self.threadonInput.start()
while(self.environment['generalInformation']['running']):
self.handleProcess()
self.environment['runtime']['debug'].writeDebugOut(environment,'happy loop at'+str(time.time()),0)
self.environment['runtime']['debug'].writeDebugOut(self.environment,'happy loop at'+str(time.time()),debug.debugLevel.ERROR)
self.shutdown()

View File

@ -28,7 +28,7 @@ class screen():
if len(newContentBytes) < 5:
return environment
except Exception as e:
environment['runtime']['debug'].writeDebugOut(environment,str(e),0)
environment['runtime']['debug'].writeDebugOut(environment,str(e),debug.debugLevel.ERROR)
return environment
screenEncoding = environment['runtime']['settingsManager'].getSetting(environment,'screen', 'encoding')
environment['generalInformation']['suspend'] = newTTY in \
@ -68,9 +68,9 @@ class screen():
environment['screenData']['newDelta'] = ''
environment['screenData']['oldNegativeDelta'] = ''
environment['screenData']['newNegativeDelta'] = ''
environment['runtime']['debug'].writeDebugOut(environment,'____CONT START_____'),0)
environment['runtime']['debug'].writeDebugOut(environment,environment['screenData']['newContentText']+ str(time.time()),0)
environment['runtime']['debug'].writeDebugOut(environment,'____CONT END____'),0)
environment['runtime']['debug'].writeDebugOut(environment,'____CONT START_____',debug.debugLevel.ERROR)
environment['runtime']['debug'].writeDebugOut(environment,environment['screenData']['newContentText']+ str(time.time()),debug.debugLevel.ERROR)
environment['runtime']['debug'].writeDebugOut(environment,'____CONT END____',debug.debugLevel.ERROR)
# changes on the screen
if (environment['screenData']['oldContentText'] != environment['screenData']['newContentText']) and \
@ -79,7 +79,7 @@ class screen():
environment['screenData']['newContentText'] != '':
environment['screenData']['newDelta'] = environment['screenData']['newContentText']
else:
environment['runtime']['debug'].writeDebugOut(environment,"diff start-------------"+ str(time.time()),0)
environment['runtime']['debug'].writeDebugOut(environment,"diff start-------------"+ str(time.time()),debug.debugLevel.ERROR)
diffStart = 0
if environment['screenData']['oldCursor']['x'] != environment['screenData']['newCursor']['x'] and \
environment['screenData']['oldCursor']['y'] == environment['screenData']['newCursor']['y'] and \
@ -92,7 +92,7 @@ class screen():
environment['screenData']['newContentText'][diffStart:].split('\n'))
diffList = list(diff)
environment['runtime']['debug'].writeDebugOut(environment,"diff end-------------"+ str(time.time()),0)
environment['runtime']['debug'].writeDebugOut(environment,"diff end-------------"+ str(time.time()),debug.debugLevel.ERROR)
environment['screenData']['newDelta'] = ''.join(x[2:] for x in diffList if x.startswith('+ '))
environment['screenData']['newNegativeDelta'] = ''.join(x[2:] for x in diffList if x.startswith('- '))

View File

@ -28,7 +28,7 @@ class debug():
if fileName != '':
self._fileName = fileName
if self._fileName != '':
self._file = open(self._fileName,'w')
self._file = open(self._fileName,'a')
self._fileOpened = True
def writeDebugOut(self, environment, text, level = debugLevel.DEACTIVE):