fix problem with initial setup of notify-level variables

This commit is contained in:
David Rose 2011-02-27 19:50:38 +00:00
parent b2031e04ac
commit 37a19945ec

View File

@ -59,21 +59,21 @@ class DirectNotify:
to set the notify severity and then set that level. You cannot to set the notify severity and then set that level. You cannot
set these until config is set. set these until config is set.
""" """
# We cannot check dconfig variables until config has been
# set. Once config is set in ShowBase.py, it tries to set # We use ConfigVariableString instead of base.config, in case
# all the levels again in case some were created before config # we're running before ShowBase has finished initializing; and
# was created. # we import it directly from libpandaexpress, in case we're
try: # running before libpanda.dll is available.
config from libpandaexpress import ConfigVariableString
except:
return 0
dconfigParam = ("notify-level-" + categoryName) dconfigParam = ("notify-level-" + categoryName)
level = config.GetString(dconfigParam, "") cvar = ConfigVariableString(dconfigParam, "")
level = cvar.getValue()
if not level: if not level:
# see if there's an override of the default config level # see if there's an override of the default config level
level = config.GetString('default-directnotify-level', 'info') cvar2 = ConfigVariableString('default-directnotify-level', 'info')
level = cvar2.getValue()
if not level: if not level:
level = 'error' level = 'error'