formatting

This commit is contained in:
Dave Schuyler 2005-10-01 02:11:54 +00:00
parent a711f19e05
commit 5f4d36e968
9 changed files with 34 additions and 34 deletions

View File

@ -858,10 +858,10 @@ class Actor(PandaObject, NodePath):
root under the given lod. root under the given lod.
""" """
# check to see if we are working within an lod # check to see if we are working within an lod
if (lodName != None): if lodName != None:
# find the named lod node # find the named lod node
lodRoot = self.find("**/" + str(lodName)) lodRoot = self.find("**/" + str(lodName))
if (root == None): if root == None:
# no need to look further # no need to look further
root = lodRoot root = lodRoot
else: else:
@ -869,10 +869,10 @@ class Actor(PandaObject, NodePath):
root = lodRoot.find("**/" + root) root = lodRoot.find("**/" + root)
else: else:
# start search from self if no root and no lod given # start search from self if no root and no lod given
if (root == None): if root == None:
root = self root = self
frontParts = root.findAllMatches( "**/" + frontPartName) frontParts = root.findAllMatches("**/" + frontPartName)
if mode > 0: if mode > 0:
# Use the 'fixed' bin instead of reordering the scene # Use the 'fixed' bin instead of reordering the scene

View File

@ -34,7 +34,7 @@ class LineNodePath(NodePath):
apply(self.lineSegs.drawTo, _args) apply(self.lineSegs.drawTo, _args)
def create(self, frameAccurate = 0): def create(self, frameAccurate = 0):
self.lineSegs.create( self.lineNode, frameAccurate ) self.lineSegs.create(self.lineNode, frameAccurate)
def reset(self): def reset(self):
self.lineSegs.reset() self.lineSegs.reset()
@ -53,7 +53,7 @@ class LineNodePath(NodePath):
apply(self.lineSegs.setVertex, _args) apply(self.lineSegs.setVertex, _args)
def setVertexColor(self, vertex, *_args): def setVertexColor(self, vertex, *_args):
apply( self.lineSegs.setVertexColor, (vertex,) + _args ) apply(self.lineSegs.setVertexColor, (vertex,) + _args)
def getCurrentPosition(self): def getCurrentPosition(self):
return self.lineSegs.getCurrentPosition() return self.lineSegs.getCurrentPosition()

View File

@ -792,14 +792,14 @@ class FFIInterrogateDatabase:
self.updateBindings(CModuleName) self.updateBindings(CModuleName)
FFIConstants.notify.info( 'Generating type code...') FFIConstants.notify.info('Generating type code...')
for type in self.environment.types.values(): for type in self.environment.types.values():
# Do not generate code for nested types at the top level # Do not generate code for nested types at the top level
if (not type.isNested): if (not type.isNested):
type.generateGlobalCode(codeDir, extensionsDir) type.generateGlobalCode(codeDir, extensionsDir)
FFIConstants.notify.info( 'Generating global downcast code...') FFIConstants.notify.info('Generating global downcast code...')
downcastFile = constructDowncastFile(codeDir, CModuleName) downcastFile = constructDowncastFile(codeDir, CModuleName)
# Output all the imports based on this list of functions # Output all the imports based on this list of functions
outputGlobalFileImports(downcastFile, outputGlobalFileImports(downcastFile,
@ -808,7 +808,7 @@ class FFIInterrogateDatabase:
for type in self.environment.downcastFunctions: for type in self.environment.downcastFunctions:
type.generateGlobalDowncastCode(downcastFile) type.generateGlobalDowncastCode(downcastFile)
FFIConstants.notify.info( 'Generating global code...') FFIConstants.notify.info('Generating global code...')
globalFile = constructGlobalFile(codeDir, CModuleName) globalFile = constructGlobalFile(codeDir, CModuleName)
# Make a list of all the global functions. This includes the normal # Make a list of all the global functions. This includes the normal
@ -836,35 +836,35 @@ class FFIInterrogateDatabase:
treeColl = FFIOverload.FFIMethodArgumentTreeCollection(None, methodSpecList) treeColl = FFIOverload.FFIMethodArgumentTreeCollection(None, methodSpecList)
treeColl.generateCode(globalFile, -1) treeColl.generateCode(globalFile, -1)
FFIConstants.notify.info( 'Generating global values...') FFIConstants.notify.info('Generating global values...')
for type in self.environment.globalValues: for type in self.environment.globalValues:
type.generateGlobalCode(globalFile) type.generateGlobalCode(globalFile)
FFIConstants.notify.info( 'Generating global functions...') FFIConstants.notify.info('Generating global functions...')
for type in self.environment.globalFunctions: for type in self.environment.globalFunctions:
type.generateGlobalCode(globalFile) type.generateGlobalCode(globalFile)
FFIConstants.notify.info( 'Generating manifests...') FFIConstants.notify.info('Generating manifests...')
for type in self.environment.manifests: for type in self.environment.manifests:
type.generateGlobalCode(globalFile) type.generateGlobalCode(globalFile)
globalFile.close() globalFile.close()
FFIConstants.notify.info( 'Generating import code...') FFIConstants.notify.info('Generating import code...')
importFile = constructImportFile(codeDir, CModuleName) importFile = constructImportFile(codeDir, CModuleName)
outputImportFileImports(importFile, self.environment.types.values(), CModuleName) outputImportFileImports(importFile, self.environment.types.values(), CModuleName)
def updateBindings(self, CModuleName): def updateBindings(self, CModuleName):
FFIConstants.notify.info( 'Updating Bindings') FFIConstants.notify.info('Updating Bindings')
FFIConstants.notify.info( 'Adding Types...') FFIConstants.notify.info('Adding Types...')
self.addTypes(CModuleName) self.addTypes(CModuleName)
FFIConstants.notify.info( 'Adding global values...') FFIConstants.notify.info('Adding global values...')
self.addGlobalValues(CModuleName) self.addGlobalValues(CModuleName)
FFIConstants.notify.info( 'Adding global functions...') FFIConstants.notify.info('Adding global functions...')
self.addGlobalFunctions(CModuleName) self.addGlobalFunctions(CModuleName)
FFIConstants.notify.info( 'Adding manifests symbols...') FFIConstants.notify.info('Adding manifests symbols...')
self.addManifestSymbols() self.addManifestSymbols()
FFIConstants.notify.info( 'Adding environment types...') FFIConstants.notify.info('Adding environment types...')
self.addEnvironmentTypes() self.addEnvironmentTypes()

View File

@ -732,7 +732,7 @@ class ClassTypeDescriptor(BaseTypeDescriptor):
extensionFileName = self.getExtensionModuleName() extensionFileName = self.getExtensionModuleName()
extensionFilePath = os.path.join(extensionsDir, extensionFileName) extensionFilePath = os.path.join(extensionsDir, extensionFileName)
if os.path.exists(extensionFilePath): 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) extensionFile = open(extensionFilePath)
indent(file, nesting+1, '\n') indent(file, nesting+1, '\n')
indent(file, nesting+1, '##################################################\n') indent(file, nesting+1, '##################################################\n')

View File

@ -2368,7 +2368,7 @@ class LevelEditor(NodePath, PandaObject):
# 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')

View File

@ -418,13 +418,13 @@ class Signature:
l = [] l = []
for arg in self.ordinary_args(): for arg in self.ordinary_args():
if defaults.has_key(arg): if defaults.has_key(arg):
l.append( arg + '=' + str(defaults[arg]) ) l.append(arg + '=' + str(defaults[arg]))
else: else:
l.append( arg ) l.append(arg)
if specials.has_key('positional'): if specials.has_key('positional'):
l.append( '*' + specials['positional'] ) l.append('*' + specials['positional'])
if specials.has_key('keyword'): if specials.has_key('keyword'):
l.append( '**' + specials['keyword'] ) l.append('**' + specials['keyword'])
return "%s(%s)" % (self.name, string.join(l, ', ')) return "%s(%s)" % (self.name, string.join(l, ', '))
else: else:
return "%s(?)" % self.name return "%s(?)" % self.name

View File

@ -141,13 +141,13 @@ class FSMInspector(AppShell):
# Compute offset fromState point # Compute offset fromState point
newFromPt = map(operator.__add__, newFromPt = map(operator.__add__,
fromCenter, fromCenter,
self.computePoint( fromState.radius, self.computePoint(fromState.radius,
angle + DELTA)) angle + DELTA))
# Compute offset toState point # Compute offset toState point
newToPt = map(operator.__sub__, newToPt = map(operator.__sub__,
toCenter, toCenter,
self.computePoint( toState.radius, self.computePoint(toState.radius,
angle - DELTA)) angle - DELTA))
return newFromPt + newToPt return newFromPt + newToPt

View File

@ -314,7 +314,7 @@ class DialWidget(Pmw.MegaWidget):
delta = self['delta'] delta = self['delta']
factors = divmod(value - self['base'], delta) factors = divmod(value - self['base'], delta)
self.rollCount = factors[0] self.rollCount = factors[0]
self.updateIndicatorRadians( (factors[1]/delta) * TWO_PI ) self.updateIndicatorRadians((factors[1]/delta) * TWO_PI)
def updateIndicatorDegrees(self, degAngle): def updateIndicatorDegrees(self, degAngle):
self.updateIndicatorRadians(degAngle * (math.pi/180.0)) self.updateIndicatorRadians(degAngle * (math.pi/180.0))

View File

@ -204,7 +204,7 @@ class EntryScale(Pmw.MegaWidget):
self.set(string.atof(strVal)) self.set(string.atof(strVal))
""" """
# Update entry to reflect formatted value # Update entry to reflect formatted value
self.entryValue.set( self.entryFormat % self.value ) self.entryValue.set(self.entryFormat % self.value)
self.entry.checkentry() self.entry.checkentry()
if self['command']: if self['command']:
self['command'](self.value) self['command'](self.value)
@ -212,9 +212,9 @@ class EntryScale(Pmw.MegaWidget):
def _entryCommand(self, event = None): def _entryCommand(self, event = None):
try: try:
val = string.atof( self.entryValue.get() ) val = string.atof(self.entryValue.get())
apply(self.onReturn,self['callbackData']) apply(self.onReturn,self['callbackData'])
self.set( val ) self.set(val)
apply(self.onReturnRelease,self['callbackData']) apply(self.onReturnRelease,self['callbackData'])
except ValueError: except ValueError:
pass pass
@ -223,7 +223,7 @@ class EntryScale(Pmw.MegaWidget):
sd = self['numDigits'] sd = self['numDigits']
self.entryFormat = '%.' + '%d' % sd + 'f' self.entryFormat = '%.' + '%d' % sd + 'f'
# And reset value to reflect change # And reset value to reflect change
self.entryValue.set( self.entryFormat % self.value) self.entryValue.set(self.entryFormat % self.value)
def get(self): def get(self):
return self.value return self.value
@ -245,12 +245,12 @@ class EntryScale(Pmw.MegaWidget):
# Update scale's position # Update scale's position
self.scale.set(newVal) self.scale.set(newVal)
# Update entry to reflect formatted value # Update entry to reflect formatted value
self.entryValue.set( self.entryFormat % self.value ) self.entryValue.set(self.entryFormat % self.value)
self.entry.checkentry() self.entry.checkentry()
# execute command # execute command
if fCommand and (self['command'] is not None): if fCommand and (self['command'] is not None):
self['command']( newVal ) self['command'](newVal)
def onReturn(self, *args): def onReturn(self, *args):
""" User redefinable callback executed on <Return> in entry """ """ User redefinable callback executed on <Return> in entry """