Browse Source

formatting

Dave Schuyler 20 years ago
parent
commit
699be47bab

+ 4 - 4
direct/src/cluster/ClusterClient.py

@@ -227,9 +227,9 @@ class DisplayConnection:
 
 
     def sendCamOffset(self,xyz,hpr):
     def sendCamOffset(self,xyz,hpr):
         ClusterClient.notify.debug("send cam offset...")
         ClusterClient.notify.debug("send cam offset...")
-        ClusterClient.notify.debug( ("packet %d xyz,hpr=%f %f %f %f %f %f" %
+        ClusterClient.notify.debug(("packet %d xyz,hpr=%f %f %f %f %f %f" %
              (self.msgHandler.packetNumber,xyz[0],xyz[1],xyz[2],
              (self.msgHandler.packetNumber,xyz[0],xyz[1],xyz[2],
-             hpr[0],hpr[1],hpr[2])) )
+             hpr[0],hpr[1],hpr[2])))
         datagram = self.msgHandler.makeCamOffsetDatagram(xyz, hpr)
         datagram = self.msgHandler.makeCamOffsetDatagram(xyz, hpr)
         self.cw.send(datagram, self.tcpConn)
         self.cw.send(datagram, self.tcpConn)
 
 
@@ -247,9 +247,9 @@ class DisplayConnection:
 
 
     def sendMoveCam(self,xyz,hpr):
     def sendMoveCam(self,xyz,hpr):
         ClusterClient.notify.debug("send cam move...")
         ClusterClient.notify.debug("send cam move...")
-        ClusterClient.notify.debug( ("packet %d xyz,hpr=%f %f %f %f %f %f" %
+        ClusterClient.notify.debug(("packet %d xyz,hpr=%f %f %f %f %f %f" %
              (self.msgHandler.packetNumber,xyz[0],xyz[1],xyz[2],
              (self.msgHandler.packetNumber,xyz[0],xyz[1],xyz[2],
-             hpr[0],hpr[1],hpr[2])) )
+             hpr[0],hpr[1],hpr[2])))
         datagram = self.msgHandler.makeCamMovementDatagram(xyz, hpr)
         datagram = self.msgHandler.makeCamMovementDatagram(xyz, hpr)
         self.cw.send(datagram, self.tcpConn)
         self.cw.send(datagram, self.tcpConn)
 
 

+ 1 - 1
direct/src/directnotify/Logger.py

@@ -87,6 +87,6 @@ class Logger:
         else:
         else:
             minutes = 0
             minutes = 0
         seconds = int(math.ceil(dt))
         seconds = int(math.ceil(dt))
-        return("%02d:%02d:%02d:%02d: " % (days, hours, minutes, seconds) )
+        return("%02d:%02d:%02d:%02d: " % (days, hours, minutes, seconds))
 
 
 
 

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

@@ -217,7 +217,7 @@ class AsyncRequest(DirectObject):
         self.accept(
         self.accept(
             self.air.getDatabaseGenerateResponseEvent(context),
             self.air.getDatabaseGenerateResponseEvent(context),
             self._doCreateObject, [name, className, values])
             self._doCreateObject, [name, className, values])
-        ## newDBRequestGen = config.GetBool( #HACK:
+        ## newDBRequestGen = config.GetBool(#HACK:
         ##     'new-database-request-generate', 1)
         ##     'new-database-request-generate', 1)
         ## if newDBRequestGen:
         ## if newDBRequestGen:
         ##     self.accept(
         ##     self.accept(

+ 1 - 1
direct/src/ffi/DoGenPyCode.py

@@ -237,7 +237,7 @@ def generateNativeWrappers():
     pandaModules = open(pandaModulesFilename, 'w')
     pandaModules = open(pandaModulesFilename, 'w')
 
 
     # Copy in any helper classes from the extensions_native directory
     # Copy in any helper classes from the extensions_native directory
-    extensionHelperFiles = [ 'extension_native_helpers.py' ]
+    extensionHelperFiles = ['extension_native_helpers.py']
     for name in extensionHelperFiles:
     for name in extensionHelperFiles:
         inFilename = os.path.join(extensionsDir, name)
         inFilename = os.path.join(extensionsDir, name)
         outFilename = os.path.join(outputCodeDir, name)
         outFilename = os.path.join(outputCodeDir, name)

+ 2 - 2
direct/src/fsm/ClassicFSM.py

@@ -47,9 +47,9 @@ class ClassicFSM(DirectObject):
         final state as:
         final state as:
 
 
         fsm = ClassicFSM.ClassicFSM('stopLight',
         fsm = ClassicFSM.ClassicFSM('stopLight',
-          [ State.State('red', enterRed, exitRed, ['green']),
+          [State.State('red', enterRed, exitRed, ['green']),
             State.State('yellow', enterYellow, exitYellow, ['red']),
             State.State('yellow', enterYellow, exitYellow, ['red']),
-            State.State('green', enterGreen, exitGreen, ['yellow']) ],
+            State.State('green', enterGreen, exitGreen, ['yellow'])],
           'red',
           'red',
           'red')
           'red')
 
 

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

@@ -48,13 +48,13 @@ class FourState:
         names is a list of state names
         names is a list of state names
         
         
         E.g.
         E.g.
-            ['off', 'opening', 'open', 'closing', 'closed', ]
+            ['off', 'opening', 'open', 'closing', 'closed',]
         
         
         e.g. 2:
         e.g. 2:
-            ['off', 'locking', 'locked', 'unlocking', 'unlocked', ]
+            ['off', 'locking', 'locked', 'unlocking', 'unlocked',]
         
         
         e.g. 3:
         e.g. 3:
-            ['off', 'deactivating', 'deactive', 'activating', 'activated', ]
+            ['off', 'deactivating', 'deactive', 'activating', 'activated',]
         
         
         durations is a list of time values (floats) or None values.
         durations is a list of time values (floats) or None values.
         
         

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

@@ -47,13 +47,13 @@ class FourStateAI:
         """
         """
         names is a list of state names
         names is a list of state names
             E.g.
             E.g.
-                ['off', 'opening', 'open', 'closing', 'closed', ]
+                ['off', 'opening', 'open', 'closing', 'closed',]
 
 
             e.g. 2:
             e.g. 2:
-                ['off', 'locking', 'locked', 'unlocking', 'unlocked', ]
+                ['off', 'locking', 'locked', 'unlocking', 'unlocked',]
 
 
             e.g. 3:
             e.g. 3:
-                ['off', 'deactivating', 'deactive', 'activating', 'activated', ]
+                ['off', 'deactivating', 'deactive', 'activating', 'activated',]
         
         
         durations is a list of durations in seconds or None values.
         durations is a list of durations in seconds or None values.
             The list of duration values should be the same length
             The list of duration values should be the same length

+ 3 - 3
direct/src/interval/MetaInterval.py

@@ -66,7 +66,7 @@ class MetaInterval(CMetaInterval):
         if kw:
         if kw:
             self.notify.error("Unexpected keyword parameters: %s" % (kw.keys()))
             self.notify.error("Unexpected keyword parameters: %s" % (kw.keys()))
 
 
-        # We must allow the old style: Track([ ival0, ival1, ... ]) as
+        # We must allow the old style: Track([ival0, ival1, ...]) as
         # well as the new style: Track(ival0, ival1, ...)
         # well as the new style: Track(ival0, ival1, ...)
 
 
         # Note: this breaks in the case of a Track with one tuple:
         # Note: this breaks in the case of a Track with one tuple:
@@ -259,8 +259,8 @@ class MetaInterval(CMetaInterval):
     def addTrack(self, list, name, relTime, relTo, duration):
     def addTrack(self, list, name, relTime, relTo, duration):
         # Adds a "track list".  This is a list of tuples of the form:
         # Adds a "track list".  This is a list of tuples of the form:
         #
         #
-        #   ( <delay>, <Interval>,
-        #       PREVIOUS_END | PREVIOUS_START | TRACK_START )
+        #   (<delay>, <Interval>,
+        #       PREVIOUS_END | PREVIOUS_START | TRACK_START)
         #
         #
         # where <delay> is a relative time, in seconds, for the
         # where <delay> is a relative time, in seconds, for the
         # <Interval> to start, relative to either the end of the
         # <Interval> to start, relative to either the end of the

+ 4 - 4
direct/src/leveleditor/LevelEditor.py

@@ -29,7 +29,7 @@ fUseCVS = base.config.GetBool("level-editor-use-cvs", 1)
 # Colors used by all color menus
 # Colors used by all color menus
 DEFAULT_COLORS = [
 DEFAULT_COLORS = [
     Vec4(1,1,1,1),
     Vec4(1,1,1,1),
-    Vec4(0.75, 0.75, 0.75, 1.0 ),
+    Vec4(0.75, 0.75, 0.75, 1.0),
     Vec4(0.5, 0.5, 0.5, 1.0),
     Vec4(0.5, 0.5, 0.5, 1.0),
     Vec4(0.25, 0.25, 0.25, 1.0)
     Vec4(0.25, 0.25, 0.25, 1.0)
     ]
     ]
@@ -47,7 +47,7 @@ BUILDING_TYPES = ['10_10', '20', '10_20', '20_10', '10_10_10',
                   ]
                   ]
 BUILDING_HEIGHTS = [10, 14, 20, 24, 25, 30]
 BUILDING_HEIGHTS = [10, 14, 20, 24, 25, 30]
 NUM_WALLS = [1,2,3]
 NUM_WALLS = [1,2,3]
-LANDMARK_SPECIAL_TYPES = ['', 'hq', 'gagshop', 'clotheshop', 'petshop', 'kartshop' ]
+LANDMARK_SPECIAL_TYPES = ['', 'hq', 'gagshop', 'clotheshop', 'petshop', 'kartshop']
 
 
 OBJECT_SNAP_POINTS = {
 OBJECT_SNAP_POINTS = {
     'street_5x20': [(Vec3(5.0,0,0), Vec3(0)),
     'street_5x20': [(Vec3(5.0,0,0), Vec3(0)),
@@ -1532,7 +1532,7 @@ class LevelEditor(NodePath, DirectObject):
         newDNALandmarkBuilding.setPos(VBase3(0))
         newDNALandmarkBuilding.setPos(VBase3(0))
         newDNALandmarkBuilding.setHpr(VBase3(0))
         newDNALandmarkBuilding.setHpr(VBase3(0))
         # Headquarters do not have doors
         # Headquarters do not have doors
-        if specialType not in [ 'hq', 'kartshop' ]:
+        if specialType not in ['hq', 'kartshop']:
             newDNADoor = self.createDoor('landmark_door')
             newDNADoor = self.createDoor('landmark_door')
             newDNALandmarkBuilding.add(newDNADoor)
             newDNALandmarkBuilding.add(newDNADoor)
         # Now place new landmark building in the world
         # Now place new landmark building in the world
@@ -2372,7 +2372,7 @@ class LevelEditor(NodePath, DirectObject):
         # Also move the camera
         # Also move the camera
         taskMgr.remove('autoMoveDelay')
         taskMgr.remove('autoMoveDelay')
         handlesToCam = direct.widget.getPos(direct.camera)
         handlesToCam = direct.widget.getPos(direct.camera)
-        handlesToCam = handlesToCam * ( direct.dr.near/handlesToCam[1])
+        handlesToCam = handlesToCam * (direct.dr.near/handlesToCam[1])
         if ((abs(handlesToCam[0]) > (direct.dr.nearWidth * 0.4)) or
         if ((abs(handlesToCam[0]) > (direct.dr.nearWidth * 0.4)) or
             (abs(handlesToCam[2]) > (direct.dr.nearHeight * 0.4))):
             (abs(handlesToCam[2]) > (direct.dr.nearHeight * 0.4))):
             taskMgr.remove('manipulateCamera')
             taskMgr.remove('manipulateCamera')

+ 1 - 1
direct/src/pyinst/archivebuilder.py

@@ -76,6 +76,6 @@ def Dependencies(script):
     #if ispkg:
     #if ispkg:
     #    rslt.append(k+'.__init__', v.__file__)
     #    rslt.append(k+'.__init__', v.__file__)
     #else:
     #else:
-    rslt.append( (k, v.__file__) )
+    rslt.append((k, v.__file__))
   return rslt
   return rslt
 
 

+ 8 - 8
direct/src/showbase/Loader.py

@@ -32,7 +32,7 @@ class Loader:
         Attempt to load a model from given file path, return
         Attempt to load a model from given file path, return
         a nodepath to the model if successful or None otherwise.
         a nodepath to the model if successful or None otherwise.
         """
         """
-        assert(Loader.notify.debug("Loading model: %s" % (modelPath) ))
+        assert(Loader.notify.debug("Loading model: %s" % (modelPath)))
         if phaseChecker:
         if phaseChecker:
             phaseChecker(modelPath)
             phaseChecker(modelPath)
         node = self.loader.loadSync(Filename(modelPath))
         node = self.loader.loadSync(Filename(modelPath))
@@ -196,12 +196,12 @@ class Loader:
         TexturePool class. Returns None if not found
         TexturePool class. Returns None if not found
         """
         """
         if alphaPath is None:
         if alphaPath is None:
-            assert(Loader.notify.debug("Loading texture: %s" % (texturePath) ))
+            assert(Loader.notify.debug("Loading texture: %s" % (texturePath)))
             if phaseChecker:
             if phaseChecker:
                 phaseChecker(texturePath)
                 phaseChecker(texturePath)
             texture = TexturePool.loadTexture(texturePath)
             texture = TexturePool.loadTexture(texturePath)
         else:
         else:
-            assert(Loader.notify.debug("Loading texture: %s %s" % (texturePath, alphaPath) ))
+            assert(Loader.notify.debug("Loading texture: %s %s" % (texturePath, alphaPath)))
             if phaseChecker:
             if phaseChecker:
                 phaseChecker(texturePath)
                 phaseChecker(texturePath)
             texture = TexturePool.loadTexture(texturePath, alphaPath)
             texture = TexturePool.loadTexture(texturePath, alphaPath)
@@ -216,7 +216,7 @@ class Loader:
         Returns a 3-D Texture object, suitable for rendering
         Returns a 3-D Texture object, suitable for rendering
         volumetric textures, if successful, or None if not.
         volumetric textures, if successful, or None if not.
         """
         """
-        assert(Loader.notify.debug("Loading 3-D texture: %s" % (texturePattern) ))
+        assert(Loader.notify.debug("Loading 3-D texture: %s" % (texturePattern)))
         if phaseChecker:
         if phaseChecker:
             phaseChecker(texturePattern)
             phaseChecker(texturePattern)
         texture = TexturePool.load3dTexture(texturePattern)
         texture = TexturePool.load3dTexture(texturePattern)
@@ -232,7 +232,7 @@ class Loader:
         None if not.
         None if not.
 
 
         """
         """
-        assert(Loader.notify.debug("Loading cube map: %s" % (texturePattern) ))
+        assert(Loader.notify.debug("Loading cube map: %s" % (texturePattern)))
         if phaseChecker:
         if phaseChecker:
             phaseChecker(texturePattern)
             phaseChecker(texturePattern)
         texture = TexturePool.loadCubeMap(texturePattern)
         texture = TexturePool.loadCubeMap(texturePattern)
@@ -251,12 +251,12 @@ class Loader:
         The texture parameter may be the return value of any previous
         The texture parameter may be the return value of any previous
         call to loadTexture(), load3DTexture(), or loadCubeMap().
         call to loadTexture(), load3DTexture(), or loadCubeMap().
         """
         """
-        assert(Loader.notify.debug("Unloading texture: %s" % (texture) ))
+        assert(Loader.notify.debug("Unloading texture: %s" % (texture)))
         TexturePool.releaseTexture(texture)
         TexturePool.releaseTexture(texture)
 
 
     # sound loading funcs
     # sound loading funcs
     def loadSfx(self, name):
     def loadSfx(self, name):
-        assert(Loader.notify.debug("Loading sound: %s" % (name) ))
+        assert(Loader.notify.debug("Loading sound: %s" % (name)))
         if phaseChecker:
         if phaseChecker:
             phaseChecker(name)
             phaseChecker(name)
         # should return a valid sound obj even if soundMgr is invalid
         # should return a valid sound obj even if soundMgr is invalid
@@ -269,7 +269,7 @@ class Loader:
         return sound
         return sound
 
 
     def loadMusic(self, name):
     def loadMusic(self, name):
-        assert(Loader.notify.debug("Loading sound: %s" % (name) ))
+        assert(Loader.notify.debug("Loading sound: %s" % (name)))
         # should return a valid sound obj even if musicMgr is invalid
         # should return a valid sound obj even if musicMgr is invalid
         sound = None
         sound = None
         if (name):
         if (name):

+ 2 - 2
direct/src/showbase/PythonUtil.py

@@ -114,8 +114,8 @@ def traceFunctionCall(frame):
     if co.co_flags & 8: n = n+1
     if co.co_flags & 8: n = n+1
     r=''
     r=''
     if dict.has_key('self'):
     if dict.has_key('self'):
-        r = '%s.'%(dict['self'].__class__.__name__, )
-    r+="%s("%(f.f_code.co_name, )
+        r = '%s.'%(dict['self'].__class__.__name__,)
+    r+="%s("%(f.f_code.co_name,)
     comma=0 # formatting, whether we should type a comma.
     comma=0 # formatting, whether we should type a comma.
     for i in range(n):
     for i in range(n):
         name = co.co_varnames[i]
         name = co.co_varnames[i]

+ 2 - 2
direct/src/tkpanels/AnimPanel.py

@@ -292,12 +292,12 @@ class ActorControl(Pmw.MegaWidget):
             activebackground = '#909090',
             activebackground = '#909090',
             text = self['text'])
             text = self['text'])
         # Top level menu
         # Top level menu
-        labelMenu = Menu(self._label, tearoff = 0 )
+        labelMenu = Menu(self._label, tearoff = 0)
         
         
         # Menu to select display mode
         # Menu to select display mode
         self.unitsVar = IntVar()
         self.unitsVar = IntVar()
         self.unitsVar.set(FRAMES)
         self.unitsVar.set(FRAMES)
-        displayMenu = Menu(labelMenu, tearoff = 0 )        
+        displayMenu = Menu(labelMenu, tearoff = 0)        
         displayMenu.add_radiobutton(label = 'Frame count',
         displayMenu.add_radiobutton(label = 'Frame count',
                                     value = FRAMES,
                                     value = FRAMES,
                                     variable = self.unitsVar,
                                     variable = self.unitsVar,

+ 2 - 2
direct/src/tkpanels/FSMInspector.py

@@ -464,9 +464,9 @@ def exitState():
     print 'exitState'
     print 'exitState'
 
 
 fsm = ClassicFSM.ClassicFSM('stopLight',
 fsm = ClassicFSM.ClassicFSM('stopLight',
-          [ State.State('red', enterState, exitState, ['green']),
+          [State.State('red', enterState, exitState, ['green']),
             State.State('yellow', enterState, exitState, ['red']),
             State.State('yellow', enterState, exitState, ['red']),
-            State.State('green', enterState, exitState, ['yellow']) ],
+            State.State('green', enterState, exitState, ['yellow'])],
           'red',
           'red',
           'red')
           'red')
 
 

+ 1 - 1
direct/src/tkpanels/Inspector.py

@@ -347,7 +347,7 @@ class InspectorWindow:
         
         
     def pop(self):
     def pop(self):
         if len(self.inspectors) > 1:
         if len(self.inspectors) > 1:
-            self.inspectors = self.inspectors[ : -1]
+            self.inspectors = self.inspectors[:-1]
             self.update()
             self.update()
 
 
     def dive(self):
     def dive(self):