From 37a19945ec135a7bc2b86100f1f3c2d840b5ea03 Mon Sep 17 00:00:00 2001 From: David Rose Date: Sun, 27 Feb 2011 19:50:38 +0000 Subject: [PATCH] fix problem with initial setup of notify-level variables --- direct/src/directnotify/DirectNotify.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/direct/src/directnotify/DirectNotify.py b/direct/src/directnotify/DirectNotify.py index c5eb4445a3..f2b8e351d1 100644 --- a/direct/src/directnotify/DirectNotify.py +++ b/direct/src/directnotify/DirectNotify.py @@ -59,21 +59,21 @@ class DirectNotify: to set the notify severity and then set that level. You cannot 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 - # all the levels again in case some were created before config - # was created. - try: - config - except: - return 0 + + # We use ConfigVariableString instead of base.config, in case + # we're running before ShowBase has finished initializing; and + # we import it directly from libpandaexpress, in case we're + # running before libpanda.dll is available. + from libpandaexpress import ConfigVariableString dconfigParam = ("notify-level-" + categoryName) - level = config.GetString(dconfigParam, "") + cvar = ConfigVariableString(dconfigParam, "") + level = cvar.getValue() if not 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: level = 'error'