mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-14 07:46:39 -04:00
attempt to work around showbase startup order issue
This commit is contained in:
parent
426ac19e1a
commit
55a769760d
@ -45,6 +45,7 @@ import gc
|
|||||||
import traceback
|
import traceback
|
||||||
|
|
||||||
from direct.directutil import Verify
|
from direct.directutil import Verify
|
||||||
|
from pandac.libpandaexpressModules import ConfigVariableBool
|
||||||
|
|
||||||
ScalarTypes = (types.FloatType, types.IntType, types.LongType)
|
ScalarTypes = (types.FloatType, types.IntType, types.LongType)
|
||||||
|
|
||||||
@ -804,14 +805,11 @@ def profiled(category=None, terse=False):
|
|||||||
|
|
||||||
def profileDecorator(f):
|
def profileDecorator(f):
|
||||||
def _profiled(*args, **kArgs):
|
def _profiled(*args, **kArgs):
|
||||||
# must do this in here because we don't have base/simbase
|
|
||||||
# at the time that PythonUtil is loaded
|
|
||||||
name = '(%s) %s from %s' % (category, f.func_name, f.__module__)
|
name = '(%s) %s from %s' % (category, f.func_name, f.__module__)
|
||||||
try:
|
|
||||||
_base = base
|
# showbase might not be loaded yet, so don't use
|
||||||
except:
|
# base.config. Instead, query the ConfigVariableBool.
|
||||||
_base = simbase
|
if (category is None) or ConfigVariableBool('want-profile-%s' % category, 0).getValue():
|
||||||
if (category is None) or _base.config.GetBool('want-profile-%s' % category, 0):
|
|
||||||
return profile(Functor(f, *args, **kArgs), name, terse)
|
return profile(Functor(f, *args, **kArgs), name, terse)
|
||||||
else:
|
else:
|
||||||
return f(*args, **kArgs)
|
return f(*args, **kArgs)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user