mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 09:52:27 -04:00
formatting
This commit is contained in:
parent
a711f19e05
commit
5f4d36e968
@ -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
|
||||
|
@ -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()
|
||||
|
@ -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()
|
||||
|
||||
|
||||
|
@ -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')
|
||||
|
@ -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')
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
@ -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))
|
||||
|
@ -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 <Return> in entry """
|
||||
|
Loading…
x
Reference in New Issue
Block a user