From 9e7337557aa390a45b21d37dfb272b40e836da8c Mon Sep 17 00:00:00 2001 From: David Rose Date: Tue, 16 Jun 2009 03:46:55 +0000 Subject: [PATCH] remove old api calls --- direct/src/showbase/ExceptionVarDump.py | 3 ++- direct/src/showbase/PythonUtil.py | 3 ++- direct/src/showbase/ShowBase.py | 3 +-- pandatool/src/flt/config_flt.cxx | 16 ++++++++++------ pandatool/src/flt/config_flt.h | 3 ++- 5 files changed, 17 insertions(+), 11 deletions(-) diff --git a/direct/src/showbase/ExceptionVarDump.py b/direct/src/showbase/ExceptionVarDump.py index f488942cbb..ddc2216353 100755 --- a/direct/src/showbase/ExceptionVarDump.py +++ b/direct/src/showbase/ExceptionVarDump.py @@ -1,4 +1,4 @@ -from pandac.PandaModules import ConfigConfigureGetConfigConfigShowbase as config +from pandac.PandaModules import getConfigShowbase from direct.directnotify.DirectNotifyGlobal import directNotify from direct.showbase.PythonUtil import fastRepr from exceptions import Exception @@ -7,6 +7,7 @@ import types import traceback notify = directNotify.newCategory("ExceptionVarDump") +config = getConfigShowbase() reentry = 0 diff --git a/direct/src/showbase/PythonUtil.py b/direct/src/showbase/PythonUtil.py index 08bd1e85e7..515dad3656 100644 --- a/direct/src/showbase/PythonUtil.py +++ b/direct/src/showbase/PythonUtil.py @@ -3746,7 +3746,8 @@ class HierarchyException(Exception): # __dev__ is not defined at import time, call this after it's defined def recordFunctorCreationStacks(): global Functor - from pandac.PandaModules import ConfigConfigureGetConfigConfigShowbase as config + from pandac.PandaModules import getConfigShowbase + config = getConfigShowbase() if __dev__ and config.GetBool('record-functor-creation-stacks', 1): if not hasattr(Functor, '_functorCreationStacksRecorded'): Functor = recordCreationStackStr(Functor) diff --git a/direct/src/showbase/ShowBase.py b/direct/src/showbase/ShowBase.py index f03e79faae..4aeb9e8a41 100644 --- a/direct/src/showbase/ShowBase.py +++ b/direct/src/showbase/ShowBase.py @@ -11,7 +11,7 @@ from pandac.PandaModules import * # This needs to be available early for DirectGUI imports import __builtin__ -__builtin__.config = ConfigConfigureGetConfigConfigShowbase +__builtin__.config = getConfigShowbase() from direct.directnotify.DirectNotifyGlobal import * from MessengerGlobal import * @@ -68,7 +68,6 @@ class ShowBase(DirectObject.DirectObject): self.debugRunningMultiplier = 4 # Get the dconfig object - #self.config = ConfigConfigureGetConfigConfigShowbase self.config = config # Setup wantVerifyPdb as soon as reasonable: Verify.wantVerifyPdb = self.config.GetBool('want-verify-pdb', 0) diff --git a/pandatool/src/flt/config_flt.cxx b/pandatool/src/flt/config_flt.cxx index f7d54e70aa..c93592e8ca 100644 --- a/pandatool/src/flt/config_flt.cxx +++ b/pandatool/src/flt/config_flt.cxx @@ -50,12 +50,16 @@ Configure(config_flt); NotifyCategoryDef(flt, ""); -// Set this true to trigger an assertion failure (and core dump) -// immediately when an error is detected on reading or writing a flt -// file. This is primarily useful for debugging the flt reader -// itself, to generate a stack trace to determine precisely at what -// point a flt file failed. -const bool flt_error_abort = config_flt.GetBool("flt-error-abort", false); + +ConfigVariableBool flt_error_abort +("flt-error-abort", false, + PRC_DESC("Set this true to trigger an assertion failure (and core dump) " + "immediately when an error is detected on reading or writing a flt " + "file. This is primarily useful for debugging the flt reader itself, " + "to generate a stack trace to determine precisely at what point a flt " + + "file failed.")); + ConfigureFn(config_flt) { init_libflt(); diff --git a/pandatool/src/flt/config_flt.h b/pandatool/src/flt/config_flt.h index a05aff9abf..480a5337e6 100644 --- a/pandatool/src/flt/config_flt.h +++ b/pandatool/src/flt/config_flt.h @@ -18,10 +18,11 @@ #include "pandatoolbase.h" #include "notifyCategoryProxy.h" +#include "configVariableBool.h" NotifyCategoryDeclNoExport(flt); -extern const bool flt_error_abort; +extern ConfigVariableBool flt_error_abort; extern void init_libflt();