From 5f4d36e9684b8ebf7a104206b2fbc0d241aea5cf Mon Sep 17 00:00:00 2001 From: Dave Schuyler Date: Sat, 1 Oct 2005 02:11:54 +0000 Subject: [PATCH] formatting --- direct/src/actor/Actor.py | 8 ++++---- direct/src/directtools/DirectGeometry.py | 4 ++-- direct/src/ffi/FFIInterrogateDatabase.py | 26 ++++++++++++------------ direct/src/ffi/FFITypes.py | 2 +- direct/src/leveleditor/LevelEditor.py | 2 +- direct/src/showbase/PythonUtil.py | 8 ++++---- direct/src/tkpanels/FSMInspector.py | 4 ++-- direct/src/tkwidgets/Dial.py | 2 +- direct/src/tkwidgets/EntryScale.py | 12 +++++------ 9 files changed, 34 insertions(+), 34 deletions(-) diff --git a/direct/src/actor/Actor.py b/direct/src/actor/Actor.py index 3a1aaff20e..c16fda52bb 100644 --- a/direct/src/actor/Actor.py +++ b/direct/src/actor/Actor.py @@ -858,10 +858,10 @@ class Actor(PandaObject, NodePath): root under the given lod. """ # check to see if we are working within an lod - if (lodName != None): + if lodName != None: # find the named lod node lodRoot = self.find("**/" + str(lodName)) - if (root == None): + if root == None: # no need to look further root = lodRoot else: @@ -869,10 +869,10 @@ class Actor(PandaObject, NodePath): root = lodRoot.find("**/" + root) else: # start search from self if no root and no lod given - if (root == None): + if root == None: root = self - frontParts = root.findAllMatches( "**/" + frontPartName) + frontParts = root.findAllMatches("**/" + frontPartName) if mode > 0: # Use the 'fixed' bin instead of reordering the scene diff --git a/direct/src/directtools/DirectGeometry.py b/direct/src/directtools/DirectGeometry.py index 9aceb937b1..1362b0a054 100644 --- a/direct/src/directtools/DirectGeometry.py +++ b/direct/src/directtools/DirectGeometry.py @@ -34,7 +34,7 @@ class LineNodePath(NodePath): apply(self.lineSegs.drawTo, _args) def create(self, frameAccurate = 0): - self.lineSegs.create( self.lineNode, frameAccurate ) + self.lineSegs.create(self.lineNode, frameAccurate) def reset(self): self.lineSegs.reset() @@ -53,7 +53,7 @@ class LineNodePath(NodePath): apply(self.lineSegs.setVertex, _args) def setVertexColor(self, vertex, *_args): - apply( self.lineSegs.setVertexColor, (vertex,) + _args ) + apply(self.lineSegs.setVertexColor, (vertex,) + _args) def getCurrentPosition(self): return self.lineSegs.getCurrentPosition() diff --git a/direct/src/ffi/FFIInterrogateDatabase.py b/direct/src/ffi/FFIInterrogateDatabase.py index b1cbc73faf..4918b7072a 100644 --- a/direct/src/ffi/FFIInterrogateDatabase.py +++ b/direct/src/ffi/FFIInterrogateDatabase.py @@ -792,14 +792,14 @@ class FFIInterrogateDatabase: self.updateBindings(CModuleName) - FFIConstants.notify.info( 'Generating type code...') + FFIConstants.notify.info('Generating type code...') for type in self.environment.types.values(): # Do not generate code for nested types at the top level if (not type.isNested): type.generateGlobalCode(codeDir, extensionsDir) - FFIConstants.notify.info( 'Generating global downcast code...') + FFIConstants.notify.info('Generating global downcast code...') downcastFile = constructDowncastFile(codeDir, CModuleName) # Output all the imports based on this list of functions outputGlobalFileImports(downcastFile, @@ -808,7 +808,7 @@ class FFIInterrogateDatabase: for type in self.environment.downcastFunctions: type.generateGlobalDowncastCode(downcastFile) - FFIConstants.notify.info( 'Generating global code...') + FFIConstants.notify.info('Generating global code...') globalFile = constructGlobalFile(codeDir, CModuleName) # Make a list of all the global functions. This includes the normal @@ -836,35 +836,35 @@ class FFIInterrogateDatabase: treeColl = FFIOverload.FFIMethodArgumentTreeCollection(None, methodSpecList) treeColl.generateCode(globalFile, -1) - FFIConstants.notify.info( 'Generating global values...') + FFIConstants.notify.info('Generating global values...') for type in self.environment.globalValues: type.generateGlobalCode(globalFile) - FFIConstants.notify.info( 'Generating global functions...') + FFIConstants.notify.info('Generating global functions...') for type in self.environment.globalFunctions: type.generateGlobalCode(globalFile) - FFIConstants.notify.info( 'Generating manifests...') + FFIConstants.notify.info('Generating manifests...') for type in self.environment.manifests: type.generateGlobalCode(globalFile) globalFile.close() - FFIConstants.notify.info( 'Generating import code...') + FFIConstants.notify.info('Generating import code...') importFile = constructImportFile(codeDir, CModuleName) outputImportFileImports(importFile, self.environment.types.values(), CModuleName) def updateBindings(self, CModuleName): - FFIConstants.notify.info( 'Updating Bindings') - FFIConstants.notify.info( 'Adding Types...') + FFIConstants.notify.info('Updating Bindings') + FFIConstants.notify.info('Adding Types...') self.addTypes(CModuleName) - FFIConstants.notify.info( 'Adding global values...') + FFIConstants.notify.info('Adding global values...') self.addGlobalValues(CModuleName) - FFIConstants.notify.info( 'Adding global functions...') + FFIConstants.notify.info('Adding global functions...') self.addGlobalFunctions(CModuleName) - FFIConstants.notify.info( 'Adding manifests symbols...') + FFIConstants.notify.info('Adding manifests symbols...') self.addManifestSymbols() - FFIConstants.notify.info( 'Adding environment types...') + FFIConstants.notify.info('Adding environment types...') self.addEnvironmentTypes() diff --git a/direct/src/ffi/FFITypes.py b/direct/src/ffi/FFITypes.py index b8ee865338..7c3d7919db 100644 --- a/direct/src/ffi/FFITypes.py +++ b/direct/src/ffi/FFITypes.py @@ -732,7 +732,7 @@ class ClassTypeDescriptor(BaseTypeDescriptor): extensionFileName = self.getExtensionModuleName() extensionFilePath = os.path.join(extensionsDir, extensionFileName) if os.path.exists(extensionFilePath): - FFIConstants.notify.info( 'Found extensions for class: ' + self.foreignTypeName) + FFIConstants.notify.info('Found extensions for class: ' + self.foreignTypeName) extensionFile = open(extensionFilePath) indent(file, nesting+1, '\n') indent(file, nesting+1, '##################################################\n') diff --git a/direct/src/leveleditor/LevelEditor.py b/direct/src/leveleditor/LevelEditor.py index ad20f4bdbb..8ea95b03e9 100644 --- a/direct/src/leveleditor/LevelEditor.py +++ b/direct/src/leveleditor/LevelEditor.py @@ -2368,7 +2368,7 @@ class LevelEditor(NodePath, PandaObject): # 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/showbase/PythonUtil.py b/direct/src/showbase/PythonUtil.py index 84a15f4208..64b3d5ee8a 100644 --- a/direct/src/showbase/PythonUtil.py +++ b/direct/src/showbase/PythonUtil.py @@ -418,13 +418,13 @@ class Signature: l = [] for arg in self.ordinary_args(): if defaults.has_key(arg): - l.append( arg + '=' + str(defaults[arg]) ) + l.append(arg + '=' + str(defaults[arg])) else: - l.append( arg ) + l.append(arg) if specials.has_key('positional'): - l.append( '*' + specials['positional'] ) + l.append('*' + specials['positional']) if specials.has_key('keyword'): - l.append( '**' + specials['keyword'] ) + l.append('**' + specials['keyword']) return "%s(%s)" % (self.name, string.join(l, ', ')) else: return "%s(?)" % self.name diff --git a/direct/src/tkpanels/FSMInspector.py b/direct/src/tkpanels/FSMInspector.py index 6e055130df..ab5ab56e8a 100644 --- a/direct/src/tkpanels/FSMInspector.py +++ b/direct/src/tkpanels/FSMInspector.py @@ -141,13 +141,13 @@ class FSMInspector(AppShell): # Compute offset fromState point newFromPt = map(operator.__add__, fromCenter, - self.computePoint( fromState.radius, + self.computePoint(fromState.radius, angle + DELTA)) # Compute offset toState point newToPt = map(operator.__sub__, toCenter, - self.computePoint( toState.radius, + self.computePoint(toState.radius, angle - DELTA)) return newFromPt + newToPt diff --git a/direct/src/tkwidgets/Dial.py b/direct/src/tkwidgets/Dial.py index bcd4ec2894..eb3edbee7c 100644 --- a/direct/src/tkwidgets/Dial.py +++ b/direct/src/tkwidgets/Dial.py @@ -314,7 +314,7 @@ class DialWidget(Pmw.MegaWidget): delta = self['delta'] factors = divmod(value - self['base'], delta) self.rollCount = factors[0] - self.updateIndicatorRadians( (factors[1]/delta) * TWO_PI ) + self.updateIndicatorRadians((factors[1]/delta) * TWO_PI) def updateIndicatorDegrees(self, degAngle): self.updateIndicatorRadians(degAngle * (math.pi/180.0)) diff --git a/direct/src/tkwidgets/EntryScale.py b/direct/src/tkwidgets/EntryScale.py index 9d7224c31c..82fe39f03e 100644 --- a/direct/src/tkwidgets/EntryScale.py +++ b/direct/src/tkwidgets/EntryScale.py @@ -204,7 +204,7 @@ class EntryScale(Pmw.MegaWidget): self.set(string.atof(strVal)) """ # Update entry to reflect formatted value - self.entryValue.set( self.entryFormat % self.value ) + self.entryValue.set(self.entryFormat % self.value) self.entry.checkentry() if self['command']: self['command'](self.value) @@ -212,9 +212,9 @@ class EntryScale(Pmw.MegaWidget): def _entryCommand(self, event = None): try: - val = string.atof( self.entryValue.get() ) + val = string.atof(self.entryValue.get()) apply(self.onReturn,self['callbackData']) - self.set( val ) + self.set(val) apply(self.onReturnRelease,self['callbackData']) except ValueError: pass @@ -223,7 +223,7 @@ class EntryScale(Pmw.MegaWidget): sd = self['numDigits'] self.entryFormat = '%.' + '%d' % sd + 'f' # And reset value to reflect change - self.entryValue.set( self.entryFormat % self.value) + self.entryValue.set(self.entryFormat % self.value) def get(self): return self.value @@ -245,12 +245,12 @@ class EntryScale(Pmw.MegaWidget): # Update scale's position self.scale.set(newVal) # Update entry to reflect formatted value - self.entryValue.set( self.entryFormat % self.value ) + self.entryValue.set(self.entryFormat % self.value) self.entry.checkentry() # execute command if fCommand and (self['command'] is not None): - self['command']( newVal ) + self['command'](newVal) def onReturn(self, *args): """ User redefinable callback executed on in entry """