Browse Source

added assertable setTrace

Darren Ranalli 18 years ago
parent
commit
2ac571f424
1 changed files with 8 additions and 0 deletions
  1. 8 0
      direct/src/showbase/PythonUtil.py

+ 8 - 0
direct/src/showbase/PythonUtil.py

@@ -2240,13 +2240,20 @@ def appendStr(obj, st):
 try:
 try:
     import pdb
     import pdb
     set_trace = pdb.set_trace
     set_trace = pdb.set_trace
+    # set_trace that can be asserted
+    def setTrace():
+        set_trace()
+        return True
     pm = pdb.pm
     pm = pdb.pm
 except:
 except:
     # we're in production, there is no pdb module. assign these to something so that the
     # we're in production, there is no pdb module. assign these to something so that the
     # __builtin__ exports will work
     # __builtin__ exports will work
+    # references in the code should either be if __dev__'d or asserted
     set_trace = None
     set_trace = None
+    setTrace = None
     pm = None
     pm = None
 
 
+
 class ScratchPad:
 class ScratchPad:
     """empty class to stick values onto"""
     """empty class to stick values onto"""
     def __init__(self, **kArgs):
     def __init__(self, **kArgs):
@@ -3060,6 +3067,7 @@ __builtin__.uniqueName = uniqueName
 __builtin__.serialNum = serialNum
 __builtin__.serialNum = serialNum
 __builtin__.profiled = profiled
 __builtin__.profiled = profiled
 __builtin__.set_trace = set_trace
 __builtin__.set_trace = set_trace
+__builtin__.setTrace = setTrace
 __builtin__.pm = pm
 __builtin__.pm = pm
 __builtin__.itype = itype
 __builtin__.itype = itype
 __builtin__.exceptionLogged = exceptionLogged
 __builtin__.exceptionLogged = exceptionLogged