Explorar el Código

remove extra paren from assert

Dave Schuyler hace 20 años
padre
commit
8887955fcf

+ 4 - 4
direct/src/controls/BattleWalker.py

@@ -177,7 +177,7 @@ class BattleWalker(GravityWalker.GravityWalker):
             if self.lifter.isOnGround():
                 if self.isAirborne:
                     self.isAirborne = 0
-                    assert(self.debugPrint("isAirborne 0 due to isOnGround() true"))
+                    assert self.debugPrint("isAirborne 0 due to isOnGround() true")
                     impact = self.lifter.getImpactVelocity()
                     if impact < -30.0:
                         messenger.send("jumpHardLand")
@@ -187,7 +187,7 @@ class BattleWalker(GravityWalker.GravityWalker):
                         if impact < -5.0:
                             self.startJumpDelay(0.2)
                         # else, ignore the little potholes.
-                assert(self.isAirborne == 0)
+                assert self.isAirborne == 0
                 self.priorParent = Vec3.zero()
                 if jump and self.mayJump:
                     # The jump button is down and we're close
@@ -195,10 +195,10 @@ class BattleWalker(GravityWalker.GravityWalker):
                     self.lifter.addVelocity(self.avatarControlJumpForce)
                     messenger.send("jumpStart")
                     self.isAirborne = 1
-                    assert(self.debugPrint("isAirborne 1 due to jump"))
+                    assert self.debugPrint("isAirborne 1 due to jump")
             else:
                 if self.isAirborne == 0:
-                    assert(self.debugPrint("isAirborne 1 due to isOnGround() false"))
+                    assert self.debugPrint("isAirborne 1 due to isOnGround() false")
                 self.isAirborne = 1
 
             self.__oldPosDelta = self.avatarNodePath.getPosDelta(render)

+ 3 - 3
direct/src/controls/DevWalker.py

@@ -39,7 +39,7 @@ class DevWalker(DirectObject.DirectObject):
         self.task = None
 
     def setWalkSpeed(self, forward, jump, reverse, rotate):
-        assert(self.debugPrint("setWalkSpeed()"))
+        assert self.debugPrint("setWalkSpeed()")
         self.avatarControlForwardSpeed=forward
         #self.avatarControlJumpForce=jump
         self.avatarControlReverseSpeed=reverse
@@ -155,7 +155,7 @@ class DevWalker(DirectObject.DirectObject):
         """
         Activate the arrow keys, etc.
         """
-        assert(self.debugPrint("enableAvatarControls"))
+        assert self.debugPrint("enableAvatarControls")
 
         if self.task:
             # remove any old
@@ -168,7 +168,7 @@ class DevWalker(DirectObject.DirectObject):
         """
         Ignore the arrow keys, etc.
         """
-        assert(self.debugPrint("disableAvatarControls"))
+        assert self.debugPrint("disableAvatarControls")
         if self.task:
             self.task.remove()
             self.task = None

+ 2 - 2
direct/src/controls/InputState.py

@@ -18,7 +18,7 @@ class InputState(DirectObject.DirectObject):
 
     def __init__(self):
         self.state = {}
-        assert(self.debugPrint("InputState()"))
+        assert self.debugPrint("InputState()")
         self.watching = {}
         self.forcing = {}
     
@@ -85,7 +85,7 @@ class InputState(DirectObject.DirectObject):
         del self.state[name]
     
     def set(self, name, isSet):
-        assert(self.debugPrint("set(name=%s, isSet=%s)"%(name, isSet)))
+        assert self.debugPrint("set(name=%s, isSet=%s)"%(name, isSet))
         self.state[name] = isSet
         # We change the name before sending it because this may
         # be the same name that messenger used to call InputState.set()

+ 6 - 6
direct/src/controls/NonPhysicsWalker.py

@@ -38,7 +38,7 @@ class NonPhysicsWalker(DirectObject.DirectObject):
         self.stopThisFrame = 0
 
     def setWalkSpeed(self, forward, jump, reverse, rotate):
-        assert(self.debugPrint("setWalkSpeed()"))
+        assert self.debugPrint("setWalkSpeed()")
         self.avatarControlForwardSpeed=forward
         #self.avatarControlJumpForce=jump
         self.avatarControlReverseSpeed=reverse
@@ -137,7 +137,7 @@ class NonPhysicsWalker(DirectObject.DirectObject):
         self.cSphereNodePath.setTag(key, value)
 
     def setCollisionsActive(self, active = 1):
-        assert(self.debugPrint("setCollisionsActive(active%s)"%(active,)))
+        assert self.debugPrint("setCollisionsActive(active%s)"%(active,))
         if self.collisionsActive != active:
             self.collisionsActive = active
             if active:
@@ -257,10 +257,10 @@ class NonPhysicsWalker(DirectObject.DirectObject):
         return Task.cont
     
     def doDeltaPos(self):
-        assert(self.debugPrint("doDeltaPos()"))
+        assert self.debugPrint("doDeltaPos()")
     
     def reset(self):
-        assert(self.debugPrint("reset()"))
+        assert self.debugPrint("reset()")
 
     def getVelocity(self):
         return self.vel
@@ -269,7 +269,7 @@ class NonPhysicsWalker(DirectObject.DirectObject):
         """
         Activate the arrow keys, etc.
         """
-        assert(self.debugPrint("enableAvatarControls"))
+        assert self.debugPrint("enableAvatarControls")
         assert self.collisionsActive
 
         taskName = "AvatarControls-%s"%(id(self),)
@@ -282,7 +282,7 @@ class NonPhysicsWalker(DirectObject.DirectObject):
         """
         Ignore the arrow keys, etc.
         """
-        assert(self.debugPrint("disableAvatarControls"))
+        assert self.debugPrint("disableAvatarControls")
         taskName = "AvatarControls-%s"%(id(self),)
         taskMgr.remove(taskName)
     

+ 3 - 3
direct/src/controls/ObserverWalker.py

@@ -74,7 +74,7 @@ class ObserverWalker(NonPhysicsWalker.NonPhysicsWalker):
         del self.pusher
 
     def setCollisionsActive(self, active = 1):
-        assert(self.debugPrint("setCollisionsActive(active%s)"%(active,)))
+        assert self.debugPrint("setCollisionsActive(active%s)"%(active,))
         if self.collisionsActive != active:
             self.collisionsActive = active
             if active:
@@ -100,12 +100,12 @@ class ObserverWalker(NonPhysicsWalker.NonPhysicsWalker):
         """
         Activate the arrow keys, etc.
         """
-        assert(self.debugPrint("enableAvatarControls"))
+        assert self.debugPrint("enableAvatarControls")
         pass
 
     def disableAvatarControls(self):
         """
         Ignore the arrow keys, etc.
         """
-        assert(self.debugPrint("disableAvatarControls"))
+        assert self.debugPrint("disableAvatarControls")
         pass

+ 15 - 15
direct/src/controls/PhysicsWalker.py

@@ -64,7 +64,7 @@ class PhysicsWalker(DirectObject.DirectObject):
 
     """
     def spawnTest(self):
-        assert(self.debugPrint("\n\nspawnTest()\n"))
+        assert self.debugPrint("\n\nspawnTest()\n")
         if not self.wantDebugIndicator:
             return
         from pandac.PandaModules import *
@@ -108,7 +108,7 @@ class PhysicsWalker(DirectObject.DirectObject):
     """
 
     def setWalkSpeed(self, forward, jump, reverse, rotate):
-        assert(self.debugPrint("setWalkSpeed()"))
+        assert self.debugPrint("setWalkSpeed()")
         self.avatarControlForwardSpeed=forward
         self.avatarControlJumpForce=jump
         self.avatarControlReverseSpeed=reverse
@@ -213,7 +213,7 @@ class PhysicsWalker(DirectObject.DirectObject):
         self.pusher.addCollider(self.cSphereNodePath, self.avatarNodePath)
 
     def setupPhysics(self, avatarNodePath):
-        assert(self.debugPrint("setupPhysics()"))
+        assert self.debugPrint("setupPhysics()")
         # Connect to Physics Manager:
         self.actorNode=ActorNode("PW physicsActor")
         self.actorNode.getPhysicsObject().setOriented(1)
@@ -269,7 +269,7 @@ class PhysicsWalker(DirectObject.DirectObject):
         """
         Set up the avatar collisions
         """
-        assert(self.debugPrint("initializeCollisions()"))
+        assert self.debugPrint("initializeCollisions()")
         
         assert not avatarNodePath.isEmpty()
         
@@ -291,7 +291,7 @@ class PhysicsWalker(DirectObject.DirectObject):
         """
         indicator is a NodePath
         """
-        assert(self.debugPrint("setAvatarPhysicsIndicator()"))
+        assert self.debugPrint("setAvatarPhysicsIndicator()")
         self.cSphereNodePath.show()
         if indicator:
             # Indicator Node:
@@ -343,7 +343,7 @@ class PhysicsWalker(DirectObject.DirectObject):
         return Task.cont
 
     def deleteCollisions(self):
-        assert(self.debugPrint("deleteCollisions()"))
+        assert self.debugPrint("deleteCollisions()")
         del self.cTrav
 
         if self.useHeightRay:
@@ -360,7 +360,7 @@ class PhysicsWalker(DirectObject.DirectObject):
         del self.getAirborneHeight
 
     def setCollisionsActive(self, active = 1):
-        assert(self.debugPrint("collisionsActive(active=%s)"%(active,)))
+        assert self.debugPrint("collisionsActive(active=%s)"%(active,))
         if self.collisionsActive != active:
             self.collisionsActive = active
             if active:
@@ -398,7 +398,7 @@ class PhysicsWalker(DirectObject.DirectObject):
         a one-time straighten-things-up operation after collisions
         have been disabled.
         """
-        assert(self.debugPrint("oneTimeCollide()"))
+        assert self.debugPrint("oneTimeCollide()")
         tempCTrav = CollisionTraverser("oneTimeCollide")
         if self.useHeightRay:
             if self.useLifter:
@@ -692,11 +692,11 @@ class PhysicsWalker(DirectObject.DirectObject):
         return Task.cont
     
     def doDeltaPos(self):
-        assert(self.debugPrint("doDeltaPos()"))
+        assert self.debugPrint("doDeltaPos()")
         self.needToDeltaPos = 1
     
     def setPriorParentVector(self):
-        assert(self.debugPrint("doDeltaPos()"))
+        assert self.debugPrint("doDeltaPos()")
         
         print "self.__oldDt", self.__oldDt, "self.__oldPosDelta", self.__oldPosDelta
         if __debug__:
@@ -705,15 +705,15 @@ class PhysicsWalker(DirectObject.DirectObject):
                               self.__oldPosDelta.pPrintValues())
         
         velocity = self.__oldPosDelta*(1/self.__oldDt)*4.0 # *4.0 is a hack
-        assert(self.debugPrint("  __oldPosDelta=%s"%(self.__oldPosDelta,)))
-        assert(self.debugPrint("  velocity=%s"%(velocity,)))
+        assert self.debugPrint("  __oldPosDelta=%s"%(self.__oldPosDelta,))
+        assert self.debugPrint("  velocity=%s"%(velocity,))
         self.priorParent.setVector(Vec3(velocity))
         if __debug__:
             if self.wantDebugIndicator:
                 onScreenDebug.add("velocity", velocity.pPrintValues())
     
     def reset(self):
-        assert(self.debugPrint("reset()"))
+        assert self.debugPrint("reset()")
         self.actorNode.getPhysicsObject().resetPosition(self.avatarNodePath.getPos())
         self.priorParent.setVector(Vec3.zero())
         self.highMark = 0
@@ -733,7 +733,7 @@ class PhysicsWalker(DirectObject.DirectObject):
         """
         Activate the arrow keys, etc.
         """
-        assert(self.debugPrint("enableAvatarControls()"))
+        assert self.debugPrint("enableAvatarControls()")
         assert self.collisionsActive
 
         if __debug__:
@@ -752,7 +752,7 @@ class PhysicsWalker(DirectObject.DirectObject):
         """
         Ignore the arrow keys, etc.
         """
-        assert(self.debugPrint("disableAvatarControls()"))
+        assert self.debugPrint("disableAvatarControls()")
         taskName = "AvatarControls-%s"%(id(self),)
         taskMgr.remove(taskName)
 

+ 14 - 14
direct/src/controls/ShipPilot.py

@@ -68,7 +68,7 @@ class ShipPilot(PhysicsWalker):
         self.ship = None
 
     def setWalkSpeed(self, forward, jump, reverse, rotate):
-        assert(self.debugPrint("setWalkSpeed()"))
+        assert self.debugPrint("setWalkSpeed()")
         self.avatarControlForwardSpeed=forward
         self.avatarControlJumpForce=0.0
         self.avatarControlReverseSpeed=reverse
@@ -235,7 +235,7 @@ class ShipPilot(PhysicsWalker):
                 shipCollWall.stash()
             
     def takedownPhysics(self):
-        assert(self.debugPrint("takedownPhysics()"))
+        assert self.debugPrint("takedownPhysics()")
         if hasattr(self, "phys"):
             for i in self.nodes:
                 i.removeNode()
@@ -244,7 +244,7 @@ class ShipPilot(PhysicsWalker):
             self.ship.worldVelocity = Vec3.zero()
             
     def setupPhysics(self, avatarNodePath):
-        assert(self.debugPrint("setupPhysics()"))
+        assert self.debugPrint("setupPhysics()")
         if avatarNodePath is None:
             return
         assert not avatarNodePath.isEmpty()
@@ -375,7 +375,7 @@ class ShipPilot(PhysicsWalker):
         """
         Set up the avatar collisions
         """
-        assert(self.debugPrint("initializeCollisions()"))
+        assert self.debugPrint("initializeCollisions()")
         self.cTrav = collisionTraverser
         self.avatarRadius = avatarRadius
         self.floorOffset = floorOffset
@@ -384,7 +384,7 @@ class ShipPilot(PhysicsWalker):
         self.backSphereOffset = backSphereOffset
 
     def deleteCollisions(self):
-        assert(self.debugPrint("deleteCollisions()"))
+        assert self.debugPrint("deleteCollisions()")
         del self.cTrav
 
         if self.useHeightRay:
@@ -413,7 +413,7 @@ class ShipPilot(PhysicsWalker):
         """
         indicator is a NodePath
         """
-        assert(self.debugPrint("setAvatarPhysicsIndicator()"))
+        assert self.debugPrint("setAvatarPhysicsIndicator()")
         self.cSphereNodePath.show()
         if indicator:
             # Indicator Node:
@@ -465,7 +465,7 @@ class ShipPilot(PhysicsWalker):
         return Task.cont
 
     def setCollisionsActive(self, active = 1):
-        assert(self.debugPrint("collisionsActive(active=%s)"%(active,)))
+        assert self.debugPrint("collisionsActive(active=%s)"%(active,))
         if self.collisionsActive != active:
             self.collisionsActive = active
             if active:
@@ -963,11 +963,11 @@ class ShipPilot(PhysicsWalker):
         return Task.cont
     
     def doDeltaPos(self):
-        assert(self.debugPrint("doDeltaPos()"))
+        assert self.debugPrint("doDeltaPos()")
         self.needToDeltaPos = 1
     
     def setPriorParentVector(self):
-        assert(self.debugPrint("doDeltaPos()"))
+        assert self.debugPrint("doDeltaPos()")
         
         #print "self.__oldDt", self.__oldDt, "self.__oldPosDelta", self.__oldPosDelta
         if __debug__:
@@ -976,15 +976,15 @@ class ShipPilot(PhysicsWalker):
                               self.__oldPosDelta.pPrintValues())
         
         velocity = self.__oldPosDelta*(1/self.__oldDt)*4.0 # *4.0 is a hack
-        assert(self.debugPrint("  __oldPosDelta=%s"%(self.__oldPosDelta,)))
-        assert(self.debugPrint("  velocity=%s"%(velocity,)))
+        assert self.debugPrint("  __oldPosDelta=%s"%(self.__oldPosDelta,))
+        assert self.debugPrint("  velocity=%s"%(velocity,))
         self.priorParent.setVector(Vec3(velocity))
         if __debug__:
             if self.wantDebugIndicator:
                 onScreenDebug.add("velocity", velocity.pPrintValues())
     
     def reset(self):
-        assert(self.debugPrint("reset()"))
+        assert self.debugPrint("reset()")
         self.actorNode.getPhysicsObject().resetPosition(
             self.avatarNodePath.getPos())
         self.priorParent.setVector(Vec3.zero())
@@ -1004,7 +1004,7 @@ class ShipPilot(PhysicsWalker):
         """
         Activate the arrow keys, etc.
         """
-        assert(self.debugPrint("enableAvatarControls()"))
+        assert self.debugPrint("enableAvatarControls()")
         assert self.collisionsActive
 
         if __debug__:
@@ -1025,7 +1025,7 @@ class ShipPilot(PhysicsWalker):
         """
         Ignore the arrow keys, etc.
         """
-        assert(self.debugPrint("disableAvatarControls()"))
+        assert self.debugPrint("disableAvatarControls()")
         taskName = "AvatarControls-%s"%(id(self),)
         taskMgr.remove(taskName)
 

+ 14 - 14
direct/src/controls/ShipPilot2.py

@@ -66,7 +66,7 @@ class ShipPilot2(PhysicsWalker):
         self.ship = None
 
     def setWalkSpeed(self, forward, jump, reverse, rotate):
-        assert(self.debugPrint("setWalkSpeed()"))
+        assert self.debugPrint("setWalkSpeed()")
         self.avatarControlForwardSpeed=forward
         self.avatarControlJumpForce=0.0
         self.avatarControlReverseSpeed=reverse
@@ -233,7 +233,7 @@ class ShipPilot2(PhysicsWalker):
                 shipCollWall.stash()
             
     def takedownPhysics(self):
-        assert(self.debugPrint("takedownPhysics()"))
+        assert self.debugPrint("takedownPhysics()")
         if hasattr(self, "phys"):
             for i in self.nodes:
                 i.removeNode()
@@ -242,7 +242,7 @@ class ShipPilot2(PhysicsWalker):
             self.ship.worldVelocity = Vec3.zero()
             
     def setupPhysics(self, avatarNodePath):
-        assert(self.debugPrint("setupPhysics()"))
+        assert self.debugPrint("setupPhysics()")
         if avatarNodePath is None:
             return
         assert not avatarNodePath.isEmpty()
@@ -418,7 +418,7 @@ class ShipPilot2(PhysicsWalker):
         
         Set up the avatar collisions
         """
-        assert(self.debugPrint("initializeCollisions()"))
+        assert self.debugPrint("initializeCollisions()")
         self.cTrav = collisionTraverser
         self.avatarRadius = avatarRadius
         self.floorOffset = floorOffset
@@ -431,7 +431,7 @@ class ShipPilot2(PhysicsWalker):
         self.height = height
 
     def deleteCollisions(self):
-        assert(self.debugPrint("deleteCollisions()"))
+        assert self.debugPrint("deleteCollisions()")
         del self.cTrav
 
         if self.useHeightRay:
@@ -460,7 +460,7 @@ class ShipPilot2(PhysicsWalker):
         """
         indicator is a NodePath
         """
-        assert(self.debugPrint("setAvatarPhysicsIndicator()"))
+        assert self.debugPrint("setAvatarPhysicsIndicator()")
         self.cSphereNodePath.show()
         if indicator:
             # Indicator Node:
@@ -512,7 +512,7 @@ class ShipPilot2(PhysicsWalker):
         return Task.cont
 
     def setCollisionsActive(self, active = 1):
-        assert(self.debugPrint("collisionsActive(active=%s)"%(active,)))
+        assert self.debugPrint("collisionsActive(active=%s)"%(active,))
         if self.collisionsActive != active:
             self.collisionsActive = active
             if active:
@@ -1019,11 +1019,11 @@ class ShipPilot2(PhysicsWalker):
         return Task.cont
     
     def doDeltaPos(self):
-        assert(self.debugPrint("doDeltaPos()"))
+        assert self.debugPrint("doDeltaPos()")
         self.needToDeltaPos = 1
     
     def setPriorParentVector(self):
-        assert(self.debugPrint("doDeltaPos()"))
+        assert self.debugPrint("doDeltaPos()")
         
         #print "self.__oldDt", self.__oldDt, "self.__oldPosDelta", self.__oldPosDelta
         if __debug__:
@@ -1032,15 +1032,15 @@ class ShipPilot2(PhysicsWalker):
                               self.__oldPosDelta.pPrintValues())
         
         velocity = self.__oldPosDelta*(1/self.__oldDt)*4.0 # *4.0 is a hack
-        assert(self.debugPrint("  __oldPosDelta=%s"%(self.__oldPosDelta,)))
-        assert(self.debugPrint("  velocity=%s"%(velocity,)))
+        assert self.debugPrint("  __oldPosDelta=%s"%(self.__oldPosDelta,))
+        assert self.debugPrint("  velocity=%s"%(velocity,))
         self.priorParent.setVector(Vec3(velocity))
         if __debug__:
             if self.wantDebugIndicator:
                 onScreenDebug.add("velocity", velocity.pPrintValues())
     
     def reset(self):
-        assert(self.debugPrint("reset()"))
+        assert self.debugPrint("reset()")
         self.actorNode.getPhysicsObject().resetPosition(
             self.avatarNodePath.getPos())
         self.priorParent.setVector(Vec3.zero())
@@ -1060,7 +1060,7 @@ class ShipPilot2(PhysicsWalker):
         """
         Activate the arrow keys, etc.
         """
-        assert(self.debugPrint("enableAvatarControls()"))
+        assert self.debugPrint("enableAvatarControls()")
         assert self.collisionsActive
 
         if __debug__:
@@ -1081,7 +1081,7 @@ class ShipPilot2(PhysicsWalker):
         """
         Ignore the arrow keys, etc.
         """
-        assert(self.debugPrint("disableAvatarControls()"))
+        assert self.debugPrint("disableAvatarControls()")
         taskName = "AvatarControls-%s"%(id(self),)
         taskMgr.remove(taskName)