migliorie ai test

This commit is contained in:
marco
2020-10-11 20:51:37 +02:00
parent a6bd8f49fa
commit 1058c3e904
5 changed files with 151 additions and 103 deletions

View File

@@ -6,6 +6,15 @@ from __future__ import unicode_literals
import inspect, os, xbmc, sys
from platformcode import config
# for test suite
try:
xbmc.KodiStub()
testMode = True
record = False
recordedLog = ''
import html
except:
testMode = False
LOG_FORMAT = '{addname}[{filename}.{function}:{line}]{sep} {message}'
DEBUG_ENABLED = config.get_setting("debug")
DEF_LEVEL = xbmc.LOGINFO if sys.version_info[0] >= 3 else xbmc.LOGNOTICE
@@ -28,6 +37,10 @@ def error(*args):
def log(*args, **kwargs):
msg = ''
for arg in args: msg += ' ' + str(arg)
if testMode and record:
global recordedLog
recordedLog += msg + '\n'
return
frame = inspect.currentframe().f_back.f_back
filename = frame.f_code.co_filename
filename = os.path.basename(filename).split('.')[0]