From 699be47babf9f1971065b5e8e9ac70de04e110f4 Mon Sep 17 00:00:00 2001 From: Dave Schuyler Date: Wed, 21 Dec 2005 04:18:47 +0000 Subject: [PATCH] formatting --- direct/src/cluster/ClusterClient.py | 8 ++++---- direct/src/directnotify/Logger.py | 2 +- direct/src/distributed/AsyncRequest.py | 2 +- direct/src/ffi/DoGenPyCode.py | 2 +- direct/src/fsm/ClassicFSM.py | 4 ++-- direct/src/fsm/FourState.py | 6 +++--- direct/src/fsm/FourStateAI.py | 6 +++--- direct/src/interval/MetaInterval.py | 6 +++--- direct/src/leveleditor/LevelEditor.py | 8 ++++---- direct/src/pyinst/archivebuilder.py | 2 +- direct/src/showbase/Loader.py | 16 ++++++++-------- direct/src/showbase/PythonUtil.py | 4 ++-- direct/src/tkpanels/AnimPanel.py | 4 ++-- direct/src/tkpanels/FSMInspector.py | 4 ++-- direct/src/tkpanels/Inspector.py | 2 +- 15 files changed, 38 insertions(+), 38 deletions(-) diff --git a/direct/src/cluster/ClusterClient.py b/direct/src/cluster/ClusterClient.py index 3cfaf20e6f..79ecff2c3b 100644 --- a/direct/src/cluster/ClusterClient.py +++ b/direct/src/cluster/ClusterClient.py @@ -227,9 +227,9 @@ class DisplayConnection: def sendCamOffset(self,xyz,hpr): 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], - hpr[0],hpr[1],hpr[2])) ) + hpr[0],hpr[1],hpr[2]))) datagram = self.msgHandler.makeCamOffsetDatagram(xyz, hpr) self.cw.send(datagram, self.tcpConn) @@ -247,9 +247,9 @@ class DisplayConnection: def sendMoveCam(self,xyz,hpr): 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], - hpr[0],hpr[1],hpr[2])) ) + hpr[0],hpr[1],hpr[2]))) datagram = self.msgHandler.makeCamMovementDatagram(xyz, hpr) self.cw.send(datagram, self.tcpConn) diff --git a/direct/src/directnotify/Logger.py b/direct/src/directnotify/Logger.py index 0df916ed79..8910e43fe4 100644 --- a/direct/src/directnotify/Logger.py +++ b/direct/src/directnotify/Logger.py @@ -87,6 +87,6 @@ class Logger: else: minutes = 0 seconds = int(math.ceil(dt)) - return("%02d:%02d:%02d:%02d: " % (days, hours, minutes, seconds) ) + return("%02d:%02d:%02d:%02d: " % (days, hours, minutes, seconds)) diff --git a/direct/src/distributed/AsyncRequest.py b/direct/src/distributed/AsyncRequest.py index f909066af7..8b4d11866e 100755 --- a/direct/src/distributed/AsyncRequest.py +++ b/direct/src/distributed/AsyncRequest.py @@ -217,7 +217,7 @@ class AsyncRequest(DirectObject): self.accept( self.air.getDatabaseGenerateResponseEvent(context), self._doCreateObject, [name, className, values]) - ## newDBRequestGen = config.GetBool( #HACK: + ## newDBRequestGen = config.GetBool(#HACK: ## 'new-database-request-generate', 1) ## if newDBRequestGen: ## self.accept( diff --git a/direct/src/ffi/DoGenPyCode.py b/direct/src/ffi/DoGenPyCode.py index 53fd9dfbf2..632d7ad45b 100644 --- a/direct/src/ffi/DoGenPyCode.py +++ b/direct/src/ffi/DoGenPyCode.py @@ -237,7 +237,7 @@ def generateNativeWrappers(): pandaModules = open(pandaModulesFilename, 'w') # Copy in any helper classes from the extensions_native directory - extensionHelperFiles = [ 'extension_native_helpers.py' ] + extensionHelperFiles = ['extension_native_helpers.py'] for name in extensionHelperFiles: inFilename = os.path.join(extensionsDir, name) outFilename = os.path.join(outputCodeDir, name) diff --git a/direct/src/fsm/ClassicFSM.py b/direct/src/fsm/ClassicFSM.py index 28c06c9c2d..8ebce43550 100644 --- a/direct/src/fsm/ClassicFSM.py +++ b/direct/src/fsm/ClassicFSM.py @@ -47,9 +47,9 @@ class ClassicFSM(DirectObject): final state as: fsm = ClassicFSM.ClassicFSM('stopLight', - [ State.State('red', enterRed, exitRed, ['green']), + [State.State('red', enterRed, exitRed, ['green']), State.State('yellow', enterYellow, exitYellow, ['red']), - State.State('green', enterGreen, exitGreen, ['yellow']) ], + State.State('green', enterGreen, exitGreen, ['yellow'])], 'red', 'red') diff --git a/direct/src/fsm/FourState.py b/direct/src/fsm/FourState.py index 4501d6c26f..2863f97e9e 100755 --- a/direct/src/fsm/FourState.py +++ b/direct/src/fsm/FourState.py @@ -48,13 +48,13 @@ class FourState: names is a list of state names E.g. - ['off', 'opening', 'open', 'closing', 'closed', ] + ['off', 'opening', 'open', 'closing', 'closed',] e.g. 2: - ['off', 'locking', 'locked', 'unlocking', 'unlocked', ] + ['off', 'locking', 'locked', 'unlocking', 'unlocked',] e.g. 3: - ['off', 'deactivating', 'deactive', 'activating', 'activated', ] + ['off', 'deactivating', 'deactive', 'activating', 'activated',] durations is a list of time values (floats) or None values. diff --git a/direct/src/fsm/FourStateAI.py b/direct/src/fsm/FourStateAI.py index 1656cb6e1e..44bcb8cb93 100755 --- a/direct/src/fsm/FourStateAI.py +++ b/direct/src/fsm/FourStateAI.py @@ -47,13 +47,13 @@ class FourStateAI: """ names is a list of state names E.g. - ['off', 'opening', 'open', 'closing', 'closed', ] + ['off', 'opening', 'open', 'closing', 'closed',] e.g. 2: - ['off', 'locking', 'locked', 'unlocking', 'unlocked', ] + ['off', 'locking', 'locked', 'unlocking', 'unlocked',] e.g. 3: - ['off', 'deactivating', 'deactive', 'activating', 'activated', ] + ['off', 'deactivating', 'deactive', 'activating', 'activated',] durations is a list of durations in seconds or None values. The list of duration values should be the same length diff --git a/direct/src/interval/MetaInterval.py b/direct/src/interval/MetaInterval.py index 698e74d612..ba03aa686f 100644 --- a/direct/src/interval/MetaInterval.py +++ b/direct/src/interval/MetaInterval.py @@ -66,7 +66,7 @@ class MetaInterval(CMetaInterval): if kw: 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, ...) # 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): # Adds a "track list". This is a list of tuples of the form: # - # ( , , - # PREVIOUS_END | PREVIOUS_START | TRACK_START ) + # (, , + # PREVIOUS_END | PREVIOUS_START | TRACK_START) # # where is a relative time, in seconds, for the # to start, relative to either the end of the diff --git a/direct/src/leveleditor/LevelEditor.py b/direct/src/leveleditor/LevelEditor.py index 048c1a486c..dc72fab44c 100644 --- a/direct/src/leveleditor/LevelEditor.py +++ b/direct/src/leveleditor/LevelEditor.py @@ -29,7 +29,7 @@ fUseCVS = base.config.GetBool("level-editor-use-cvs", 1) # Colors used by all color menus DEFAULT_COLORS = [ 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.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] NUM_WALLS = [1,2,3] -LANDMARK_SPECIAL_TYPES = ['', 'hq', 'gagshop', 'clotheshop', 'petshop', 'kartshop' ] +LANDMARK_SPECIAL_TYPES = ['', 'hq', 'gagshop', 'clotheshop', 'petshop', 'kartshop'] OBJECT_SNAP_POINTS = { 'street_5x20': [(Vec3(5.0,0,0), Vec3(0)), @@ -1532,7 +1532,7 @@ class LevelEditor(NodePath, DirectObject): newDNALandmarkBuilding.setPos(VBase3(0)) newDNALandmarkBuilding.setHpr(VBase3(0)) # Headquarters do not have doors - if specialType not in [ 'hq', 'kartshop' ]: + if specialType not in ['hq', 'kartshop']: newDNADoor = self.createDoor('landmark_door') newDNALandmarkBuilding.add(newDNADoor) # Now place new landmark building in the world @@ -2372,7 +2372,7 @@ class LevelEditor(NodePath, DirectObject): # Also move the camera taskMgr.remove('autoMoveDelay') 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 (abs(handlesToCam[2]) > (direct.dr.nearHeight * 0.4))): taskMgr.remove('manipulateCamera') diff --git a/direct/src/pyinst/archivebuilder.py b/direct/src/pyinst/archivebuilder.py index 99e24cc131..cfc058e212 100644 --- a/direct/src/pyinst/archivebuilder.py +++ b/direct/src/pyinst/archivebuilder.py @@ -76,6 +76,6 @@ def Dependencies(script): #if ispkg: # rslt.append(k+'.__init__', v.__file__) #else: - rslt.append( (k, v.__file__) ) + rslt.append((k, v.__file__)) return rslt diff --git a/direct/src/showbase/Loader.py b/direct/src/showbase/Loader.py index 0b34717e9d..4fff6d9c3d 100644 --- a/direct/src/showbase/Loader.py +++ b/direct/src/showbase/Loader.py @@ -32,7 +32,7 @@ class Loader: Attempt to load a model from given file path, return 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: phaseChecker(modelPath) node = self.loader.loadSync(Filename(modelPath)) @@ -196,12 +196,12 @@ class Loader: TexturePool class. Returns None if not found """ if alphaPath is None: - assert(Loader.notify.debug("Loading texture: %s" % (texturePath) )) + assert(Loader.notify.debug("Loading texture: %s" % (texturePath))) if phaseChecker: phaseChecker(texturePath) texture = TexturePool.loadTexture(texturePath) else: - assert(Loader.notify.debug("Loading texture: %s %s" % (texturePath, alphaPath) )) + assert(Loader.notify.debug("Loading texture: %s %s" % (texturePath, alphaPath))) if phaseChecker: phaseChecker(texturePath) texture = TexturePool.loadTexture(texturePath, alphaPath) @@ -216,7 +216,7 @@ class Loader: Returns a 3-D Texture object, suitable for rendering 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: phaseChecker(texturePattern) texture = TexturePool.load3dTexture(texturePattern) @@ -232,7 +232,7 @@ class Loader: None if not. """ - assert(Loader.notify.debug("Loading cube map: %s" % (texturePattern) )) + assert(Loader.notify.debug("Loading cube map: %s" % (texturePattern))) if phaseChecker: phaseChecker(texturePattern) texture = TexturePool.loadCubeMap(texturePattern) @@ -251,12 +251,12 @@ class Loader: The texture parameter may be the return value of any previous 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) # sound loading funcs def loadSfx(self, name): - assert(Loader.notify.debug("Loading sound: %s" % (name) )) + assert(Loader.notify.debug("Loading sound: %s" % (name))) if phaseChecker: phaseChecker(name) # should return a valid sound obj even if soundMgr is invalid @@ -269,7 +269,7 @@ class Loader: return sound 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 sound = None if (name): diff --git a/direct/src/showbase/PythonUtil.py b/direct/src/showbase/PythonUtil.py index b2992ddc50..62c120454b 100644 --- a/direct/src/showbase/PythonUtil.py +++ b/direct/src/showbase/PythonUtil.py @@ -114,8 +114,8 @@ def traceFunctionCall(frame): if co.co_flags & 8: n = n+1 r='' 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. for i in range(n): name = co.co_varnames[i] diff --git a/direct/src/tkpanels/AnimPanel.py b/direct/src/tkpanels/AnimPanel.py index bf72a304a4..4e6dfdd453 100644 --- a/direct/src/tkpanels/AnimPanel.py +++ b/direct/src/tkpanels/AnimPanel.py @@ -292,12 +292,12 @@ class ActorControl(Pmw.MegaWidget): activebackground = '#909090', text = self['text']) # Top level menu - labelMenu = Menu(self._label, tearoff = 0 ) + labelMenu = Menu(self._label, tearoff = 0) # Menu to select display mode self.unitsVar = IntVar() self.unitsVar.set(FRAMES) - displayMenu = Menu(labelMenu, tearoff = 0 ) + displayMenu = Menu(labelMenu, tearoff = 0) displayMenu.add_radiobutton(label = 'Frame count', value = FRAMES, variable = self.unitsVar, diff --git a/direct/src/tkpanels/FSMInspector.py b/direct/src/tkpanels/FSMInspector.py index b0a2cf86f0..643d6948e5 100644 --- a/direct/src/tkpanels/FSMInspector.py +++ b/direct/src/tkpanels/FSMInspector.py @@ -464,9 +464,9 @@ def exitState(): print 'exitState' fsm = ClassicFSM.ClassicFSM('stopLight', - [ State.State('red', enterState, exitState, ['green']), + [State.State('red', enterState, exitState, ['green']), State.State('yellow', enterState, exitState, ['red']), - State.State('green', enterState, exitState, ['yellow']) ], + State.State('green', enterState, exitState, ['yellow'])], 'red', 'red') diff --git a/direct/src/tkpanels/Inspector.py b/direct/src/tkpanels/Inspector.py index 2a65b76815..88dea7744c 100644 --- a/direct/src/tkpanels/Inspector.py +++ b/direct/src/tkpanels/Inspector.py @@ -347,7 +347,7 @@ class InspectorWindow: def pop(self): if len(self.inspectors) > 1: - self.inspectors = self.inspectors[ : -1] + self.inspectors = self.inspectors[:-1] self.update() def dive(self):