better debug print logic

This commit is contained in:
Joe Shochet 2005-03-10 00:47:04 +00:00
parent 49e4024ed3
commit b04c601d20

View File

@ -15,8 +15,6 @@ from direct.showbase import DirectObject
from PyDatagram import PyDatagram from PyDatagram import PyDatagram
#from PyDatagramIterator import PyDatagramIterator #from PyDatagramIterator import PyDatagramIterator
WantInterestPrintout = 0
class DoInterestManager(DirectObject.DirectObject): class DoInterestManager(DirectObject.DirectObject):
""" """
Top level Interest Manager Top level Interest Manager
@ -24,11 +22,9 @@ class DoInterestManager(DirectObject.DirectObject):
if __debug__: if __debug__:
notify = DirectNotifyGlobal.directNotify.newCategory("DoInterestManager") notify = DirectNotifyGlobal.directNotify.newCategory("DoInterestManager")
_interestIdAssign = 1; _interestIdAssign = 1;
_interestIdScopes = 100; _interestIdScopes = 100;
_interests = {} _interests = {}
def __init__(self): def __init__(self):
assert self.notify.debugCall() assert self.notify.debugCall()
@ -130,20 +126,19 @@ class DoInterestManager(DirectObject.DirectObject):
if __debug__: if __debug__:
def printInterests(self): def printInterests(self):
if not WantInterestPrintout:
return 1
""" """
Part of the new otp-server code. Part of the new otp-server code.
""" """
print "*********************** Interest Sets **************" if self.notify.getDebug():
for i in DoInterestManager._interests.keys(): print "*********************** Interest Sets **************"
print "Interest ID:%s, Description=%s Scope=%s Event=%s Mode=%s"%( for i in DoInterestManager._interests.keys():
i, print "Interest ID:%s, Description=%s Scope=%s Event=%s Mode=%s"%(
DoInterestManager._interests[i][0], i,
DoInterestManager._interests[i][1], DoInterestManager._interests[i][0],
DoInterestManager._interests[i][2], DoInterestManager._interests[i][1],
DoInterestManager._interests[i][3]) DoInterestManager._interests[i][2],
print "****************************************************" DoInterestManager._interests[i][3])
print "****************************************************"
return 1 # for assert() return 1 # for assert()
def _sendAddInterest(self, contextId, scopeId, parentId, zoneIdList): def _sendAddInterest(self, contextId, scopeId, parentId, zoneIdList):