From 88a6484ab33042309bd62989b571311d8a50e744 Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 20 Feb 2023 20:59:33 +0100 Subject: [PATCH] PythonUtil: Remove unused "superlog" functions --- direct/src/showbase/PythonUtil.py | 39 +------------------------------ 1 file changed, 1 insertion(+), 38 deletions(-) diff --git a/direct/src/showbase/PythonUtil.py b/direct/src/showbase/PythonUtil.py index 2c1768413d..231b343a96 100644 --- a/direct/src/showbase/PythonUtil.py +++ b/direct/src/showbase/PythonUtil.py @@ -20,8 +20,7 @@ __all__ = [ 'nullGen', 'loopGen', 'makeFlywheelGen', 'flywheel', 'listToIndex2item', 'listToItem2index', 'formatTimeCompact', 'deeptype', 'StdoutCapture', 'StdoutPassthrough', 'Averager', 'getRepository', 'formatTimeExact', - 'startSuperLog', 'endSuperLog', 'typeName', 'safeTypeName', - 'histogramDict', 'unescapeHtmlString', + 'typeName', 'safeTypeName', 'histogramDict', 'unescapeHtmlString', ] if __debug__: @@ -2401,42 +2400,6 @@ class Default: # useful for keyword arguments to virtual methods pass -superLogFile = None -def startSuperLog(customFunction = None): - global superLogFile - - if not superLogFile: - superLogFile = open("c:\\temp\\superLog.txt", "w") - def trace_dispatch(a,b,c): - if b == 'call' and a.f_code.co_name != '?' and a.f_code.co_name.find("safeRepr") < 0: - vars = dict(a.f_locals) - if 'self' in vars: - del vars['self'] - if '__builtins__' in vars: - del vars['__builtins__'] - for i in vars: - vars[i] = safeReprTypeOnFail(vars[i]) - - if customFunction: - superLogFile.write( "before = %s\n"%customFunction()) - - superLogFile.write( "%s(%s):%s:%s\n"%(a.f_code.co_filename.split("\\")[-1],a.f_code.co_firstlineno, a.f_code.co_name, vars)) - - if customFunction: - superLogFile.write( "after = %s\n"%customFunction()) - - - - return trace_dispatch - sys.settrace(trace_dispatch) - -def endSuperLog(): - global superLogFile - if superLogFile: - sys.settrace(None) - superLogFile.close() - superLogFile = None - def configIsToday(configName): # TODO: replace usage of strptime with something else # returns true if config string is a valid representation of today's date