Notify fixes for running without __debug__

This commit is contained in:
M. Ian Graham 2007-10-10 22:15:17 +00:00
parent 0f7c51ec80
commit e527327b69
7 changed files with 7 additions and 25 deletions

View File

@ -38,8 +38,7 @@ class AsyncRequest(DirectObject):
"""
_asyncRequests = {}
if __debug__:
notify = DirectNotifyGlobal.directNotify.newCategory('AsyncRequest')
notify = DirectNotifyGlobal.directNotify.newCategory('AsyncRequest')
def __init__(self, air, replyToChannelId = None,
timeoutTime = ASYNC_REQUEST_DEFAULT_TIMEOUT_IN_SECONDS,

View File

@ -2,13 +2,9 @@
from DistributedObjectAI import DistributedObjectAI
from direct.directnotify.DirectNotifyGlobal import directNotify
if __debug__:
notify = directNotify.newCategory('DistributedObjectGlobalAI')
class DistributedObjectGlobalAI(DistributedObjectAI):
if __debug__:
notify = notify
notify = directNotify.newCategory('DistributedObjectGlobalAI')
doNotDeallocateChannel = 1
isGlobalDistObj = 1
@ -33,4 +29,4 @@ class DistributedObjectGlobalAI(DistributedObjectAI):
except AttributeError:
self.air.unregisterForChannel(self.doId)
## self.air.removeDOFromTables(self)

View File

@ -3,13 +3,9 @@
from DistributedObjectUD import DistributedObjectUD
from direct.directnotify.DirectNotifyGlobal import directNotify
if __debug__:
notify = directNotify.newCategory('DistributedObjectGlobalUD')
class DistributedObjectGlobalUD(DistributedObjectUD):
if __debug__:
notify = notify
notify = directNotify.newCategory('DistributedObjectGlobalUD')
doNotDeallocateChannel = 1
isGlobalDistObj = 1

View File

@ -32,8 +32,7 @@ class NetMessenger(Messenger):
are sent over the network and (possibly) handled (accepted) on a
remote machine (server).
"""
if __debug__:
notify = DirectNotifyGlobal.directNotify.newCategory('NetMessenger')
notify = DirectNotifyGlobal.directNotify.newCategory('NetMessenger')
def __init__(self, air, channels):
"""

View File

@ -43,9 +43,7 @@ class FourState:
I found that this pattern repeated in several things I was
working on, so this base class was created.
"""
if __debug__:
notify = DirectNotifyGlobal.directNotify.newCategory(
'FourState')
notify = DirectNotifyGlobal.directNotify.newCategory('FourState')
def __init__(self, names, durations = [0, 1, None, 1, 1]):
"""

View File

@ -43,9 +43,7 @@ class FourStateAI:
I found that this pattern repeated in several things I was
working on, so this base class was created.
"""
if __debug__:
notify = DirectNotifyGlobal.directNotify.newCategory(
'FourStateAI')
notify = DirectNotifyGlobal.directNotify.newCategory('FourStateAI')
def __init__(self, names, durations = [0, 1, None, 1, 1]):
"""

View File

@ -8,7 +8,6 @@ The port will need to be defined when the instance is inited.
import string, time, direct, inspect
from operator import itemgetter
from direct.directnotify.DirectNotifyGlobal import directNotify
from direct.http import WebRequest
from socket import gethostname
from direct.task.Task import Task
@ -22,9 +21,6 @@ if platform == 'win32':
else:
from linuxSystemInfo import SystemInformation
if __debug__:
notify = directNotify.newCategory('AIWebInterface')
class aiWebServer(SystemInformation):
def __init__(self, air, listenPort=8080):
SystemInformation.__init__(self)