浏览代码

putting prints into notify debug

Josh Wilson 17 年之前
父节点
当前提交
ff36d3e428
共有 1 个文件被更改,包括 4 次插入3 次删除
  1. 4 3
      direct/src/controls/ControlManager.py

+ 4 - 3
direct/src/controls/ControlManager.py

@@ -22,6 +22,7 @@ class ControlManager:
     wantWASD = config.GetBool('want-WASD', 0)
     wantWASD = config.GetBool('want-WASD', 0)
 
 
     def __init__(self, enable=True, passMessagesThrough = False):
     def __init__(self, enable=True, passMessagesThrough = False):
+        assert self.notify.debug("init control manager %s" % (passMessagesThrough))
         assert self.notify.debugCall(id(self))
         assert self.notify.debugCall(id(self))
         self.passMessagesThrough = passMessagesThrough
         self.passMessagesThrough = passMessagesThrough
         self.inputStateTokens = []
         self.inputStateTokens = []
@@ -64,7 +65,7 @@ class ControlManager:
         assert controls is not None
         assert controls is not None
         oldControls = self.controls.get(name)
         oldControls = self.controls.get(name)
         if oldControls is not None:
         if oldControls is not None:
-            print "Replacing controls:", name
+            assert self.notify.debug("Replacing controls: %s" % name)
             oldControls.disableAvatarControls()
             oldControls.disableAvatarControls()
             oldControls.setCollisionsActive(0)
             oldControls.setCollisionsActive(0)
             oldControls.delete()
             oldControls.delete()
@@ -89,7 +90,7 @@ class ControlManager:
         assert self.notify.debugCall(id(self))
         assert self.notify.debugCall(id(self))
         oldControls = self.controls.pop(name,None)
         oldControls = self.controls.pop(name,None)
         if oldControls is not None:
         if oldControls is not None:
-            print "Removing controls:", name
+            assert self.notify.debug("Removing controls: %s" % name)
             oldControls.disableAvatarControls()
             oldControls.disableAvatarControls()
             oldControls.setCollisionsActive(0)
             oldControls.setCollisionsActive(0)
 
 
@@ -130,7 +131,7 @@ class ControlManager:
             #else:
             #else:
             #    print "Controls are already", name
             #    print "Controls are already", name
         else:
         else:
-            print "Unkown controls:", name
+            assert self.notify.debug("Unkown controls: %s" % name)
 
 
     def setSpeeds(self, forwardSpeed, jumpForce,
     def setSpeeds(self, forwardSpeed, jumpForce,
             reverseSpeed, rotateSpeed, strafeLeft=0, strafeRight=0):
             reverseSpeed, rotateSpeed, strafeLeft=0, strafeRight=0):