Browse Source

Notify fixes for running without __debug__

M. Ian Graham 18 years ago
parent
commit
e527327b69

+ 1 - 2
direct/src/distributed/AsyncRequest.py

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

+ 2 - 6
direct/src/distributed/DistributedObjectGlobalAI.py

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

+ 1 - 5
direct/src/distributed/DistributedObjectGlobalUD.py

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

+ 1 - 2
direct/src/distributed/NetMessenger.py

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

+ 1 - 3
direct/src/fsm/FourState.py

@@ -43,9 +43,7 @@ class FourState:
     I found that this pattern repeated in several things I was
     I found that this pattern repeated in several things I was
     working on, so this base class was created.
     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]):
     def __init__(self, names, durations = [0, 1, None, 1, 1]):
         """
         """

+ 1 - 3
direct/src/fsm/FourStateAI.py

@@ -43,9 +43,7 @@ class FourStateAI:
     I found that this pattern repeated in several things I was
     I found that this pattern repeated in several things I was
     working on, so this base class was created.
     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]):
     def __init__(self, names, durations = [0, 1, None, 1, 1]):
         """
         """

+ 0 - 4
direct/src/http/webAIInspector.py

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