formatting

This commit is contained in:
Dave Schuyler 2005-07-01 01:29:36 +00:00
parent 7cbdfe35bb
commit 231d582a86
23 changed files with 83 additions and 91 deletions

View File

@ -5,10 +5,6 @@ from direct.distributed import DistributedNode
import Actor
class DistributedActor(DistributedNode.DistributedNode, Actor.Actor):
"""Distributed Actor class:"""
# Constructor for DistributedActor
def __init__(self, cr):
try:
self.DistributedActor_initialized
@ -20,16 +16,12 @@ class DistributedActor(DistributedNode.DistributedNode, Actor.Actor):
# rather cache them than delete them if possible.
self.setCacheable(1)
# Disable the DistributedActor
def disable(self):
# remove all anims, on all parts and all lods
if (not self.isEmpty()):
Actor.Actor.unloadAnims(self, None, None, None)
DistributedNode.DistributedNode.disable(self)
# Delete the DistributedActor
def delete(self):
try:
self.DistributedActor_deleted
@ -40,4 +32,4 @@ class DistributedActor(DistributedNode.DistributedNode, Actor.Actor):
def loop(self, animName, restart=1, partName=None,fromFrame=None, toFrame=None):
return Actor.Actor.loop(self,animName,restart,partName,fromFrame,toFrame);
return Actor.Actor.loop(self,animName,restart,partName,fromFrame,toFrame)

View File

@ -199,7 +199,7 @@ def qSlerp(startQuat, endQuat, t):
# If the above dot product is negative, it would be better to
# go between the negative of the initial and the final, so that
# we take the shorter path.
if ( cosOmega < 0.0 ):
if cosOmega < 0.0:
cosOmega *= -1
startQ.setI(-1 * startQ.getI())
startQ.setJ(-1 * startQ.getJ())

View File

@ -505,7 +505,7 @@ class ClientRepository(ConnectionRepository):
# This method is only used in conjunction with the CMU LAN
# server.
assert(self.DOIDnext < self.DOIDlast);
assert self.DOIDnext < self.DOIDlast
zone = di.getUint32()
for obj in self.doId2do.values():
if obj.zone == zone:
@ -672,16 +672,16 @@ class ClientRepository(ConnectionRepository):
"""
This Will Move The avatar and set an interest to that location ..
"""
parentId = parentIdin;
parentId = parentIdin
if parentId is None:
parentId = base.localAvatar.defaultShard;
parentId = base.localAvatar.defaultShard
MyAvID = base.localAvatar.doId;
MyAvID = base.localAvatar.doId
# move thwe avatar..
self.sendSetLocation(MyAvID,parentId,zoneId);
self.sendSetLocation(MyAvID,parentId,zoneId)
# move the interest..
InterestZones = zoneId;
InterestZones = zoneId
if visibleZoneList is not None:
InterestZones = visibleZoneList
@ -691,8 +691,8 @@ class ClientRepository(ConnectionRepository):
self.alterInterest(self.old_setzone_interest_handle,parentId, InterestZones, "OldSetZone Imulator", event)
def sendEmulateSetZoneOff(self):
MyAvID = base.localAvatar.doId;
self.sendSetLocation(MyAvID,0,0);
MyAvID = base.localAvatar.doId
self.sendSetLocation(MyAvID,0,0)
if self.old_setzone_interest_handle is not None:
self.removeInterest(self.old_setzone_interest_handle)
self.old_setzone_interest_handle = None

View File

@ -231,7 +231,7 @@ class ConnectionRepository(
if hasProxy:
self.notify.info("Connecting to gameserver via proxy list: %s" % (proxies))
else:
self.notify.info("Connecting to gameserver directly (no proxy).");
self.notify.info("Connecting to gameserver directly (no proxy).")
if self.connectMethod == 'http':
self.connectHttp = 1

View File

@ -283,7 +283,7 @@ class DistributedObjectAI(DirectObject):
if wantOtpServer:
def GetPuppetConnectionChannel(self, doId):
return doId + (1L << 32);
return doId + (1L << 32)
def GetAccountIDFromChannelCode(self, channel):
return channel >> 32

View File

@ -82,7 +82,7 @@ class DoCollectionManager:
Counts the number of objects of the given type in the
repository (for testing purposes)
"""
count = 0;
count = 0
for dobj in self.doId2do.values():
if isinstance(dobj, classType):
count += 1
@ -293,7 +293,7 @@ class DoCollectionManager:
# NON OTP
def changeDOZoneInTables(self, do, newZoneId, oldZoneId):
##print "changeDOZoneInTables:%s, dclass:%s, newZoneId:%s OldZoneId:%s"%(do.doId, do.dclass.getName(), newZoneId,oldZoneId);
##print "changeDOZoneInTables:%s, dclass:%s, newZoneId:%s OldZoneId:%s"%(do.doId, do.dclass.getName(), newZoneId,oldZoneId)
assert self.notify.debugStateCall(self)
assert oldZoneId in self.zoneId2doIds

View File

@ -22,8 +22,8 @@ class DoInterestManager(DirectObject.DirectObject):
if __debug__:
notify = DirectNotifyGlobal.directNotify.newCategory("DoInterestManager")
_interestIdAssign = 1;
_interestIdScopes = 100;
_interestIdAssign = 1
_interestIdScopes = 100
_interests = {}
if __debug__:
_debug_currentInterests = []
@ -85,11 +85,11 @@ class DoInterestManager(DirectObject.DirectObject):
if event is not None:
DoInterestManager._interestIdScopes += 1
DoInterestManager._interests[contextId][1] = DoInterestManager._interestIdScopes;
DoInterestManager._interests[contextId][1] = DoInterestManager._interestIdScopes
else:
DoInterestManager._interests[contextId][1] = 0;
DoInterestManager._interests[contextId][1] = 0
DoInterestManager._interests[contextId][2] = event;
DoInterestManager._interests[contextId][2] = event
self._sendAddInterest(contextId,DoInterestManager._interests[contextId][1], parentId, zoneIdList)
answer = 1
assert self.printInterestsIfDebug()
@ -106,7 +106,7 @@ class DoInterestManager(DirectObject.DirectObject):
assert self.notify.debugCall()
answer = 0
if DoInterestManager._interests.has_key(contextId):
answer = DoInterestManager._interests[contextId][1];
answer = DoInterestManager._interests[contextId][1]
else:
self.notify.warning("GetInterestScopeID: contextId not found: %s" % (contextId))
return answer
@ -119,7 +119,7 @@ class DoInterestManager(DirectObject.DirectObject):
assert self.notify.debugCall()
answer = None
if DoInterestManager._interests.has_key(contextId):
answer = DoInterestManager._interests[contextId][2];
answer = DoInterestManager._interests[contextId][2]
else:
self.notify.warning("GetInterestScopeEvent: contextId not found: %s" % (contextId))
return answer

View File

@ -773,7 +773,7 @@ class FFIInterrogateDatabase:
pandaSqueezeTool.squeeze(squeezedName, unsqueezedName,
files, outputDir)
if( deleteSource ):
if deleteSource:
# Remove the now-squeezed source files.
for file in files:
os.remove(file)

View File

@ -978,7 +978,7 @@ class ClassTypeDescriptor(BaseTypeDescriptor):
#indent(file, nesting, 'returnObject = ')
#file.write('FFIExternalObject.FFIInstance('+ typeName + ',returnValue,'+str(userManagesMemory)+')\n')
#indent(file,nesting, 'returnObject.this = 0\n');
#indent(file,nesting, 'returnObject.this = 0\n')
#indent(file,nesting, 'returnObject.userManagesMemory = 0\n');
##

View File

@ -14,7 +14,7 @@
#
##############################################################
import sys,os;
import sys,os
##############################################################
#

View File

@ -169,8 +169,8 @@ class DirectEntry(DirectFrame):
lineHeight = self.onscreenText.textNode.getLineHeight()
numLines = self['numLines']
width = self['width']
self.ll.set(0.0, 0.0, -0.3 * lineHeight - (lineHeight * (numLines - 1)));
self.ur.set(width, 0.0, lineHeight * 1.3);
self.ll.set(0.0, 0.0, -0.3 * lineHeight - (lineHeight * (numLines - 1)))
self.ur.set(width, 0.0, lineHeight * 1.3)
# Scale bounds to give a pad around graphics. We also want to
# scale around the border width.

View File

@ -397,7 +397,7 @@ def DNASetBaselineString(baseline, text):
# replace each text item and then add or remove at the end.
# This should allow inlined graphics to stay in place.
# end of todo.
DNARemoveAllChildrenOfClass(baseline, DNA_SIGN_TEXT);
DNARemoveAllChildrenOfClass(baseline, DNA_SIGN_TEXT)
# We can't just blindly iterate through the text, because it might
# be utf-8 encoded, meaning some characters are represented using
@ -1528,7 +1528,7 @@ class LevelEditor(NodePath, PandaObject):
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
@ -1601,10 +1601,10 @@ class LevelEditor(NodePath, PandaObject):
baseline = DNASignBaseline('baseline')
baseline.setCode("humanist")
baseline.setColor(VBase4(0.0, 0.0, 0.0, 1.0))
#baseline.setKern(1.0);
#baseline.setWiggle(30.0);
#baseline.setStumble(1.0);
#baseline.setStomp(10.0);
#baseline.setKern(1.0)
#baseline.setWiggle(30.0)
#baseline.setStumble(1.0)
#baseline.setStomp(10.0)
#baseline.setWidth(16.0)
#baseline.setHeight(16.0)
baseline.setScale(VBase3(0.7, 1.0, 0.7))
@ -5568,7 +5568,7 @@ class LevelEditorPanel(Pmw.MegaToplevel):
flags=settings['flags']
if flags != None:
self.bigFirstLetterIntVar.set('b' in flags)
self.setBigFirstLetter();
self.setBigFirstLetter()
self.allCapsIntVar.set('c' in flags)
self.setAllCaps()
@ -5606,7 +5606,7 @@ class LevelEditorPanel(Pmw.MegaToplevel):
def setBaselineString(self, val):
baseline=self.currentBaselineDNA
if baseline:
DNASetBaselineString(baseline, val);
DNASetBaselineString(baseline, val)
self.baselineMenu.delete(self.currentBaselineIndex)
self.baselineMenu.insert(self.currentBaselineIndex, val)
self.baselineMenu.selectitem(self.currentBaselineIndex)

View File

@ -351,7 +351,7 @@ class Particles(ParticleSystem):
segIdList = eval('['+cim.getSegmentIdList().replace(' ',', ')+']')
for sid in segIdList:
seg = cim.getSegment(sid)
if( seg.isEnabled() ):
if seg.isEnabled():
t_b = seg.getTimeBegin()
t_e = seg.getTimeEnd()
fun = seg.getFunction()
@ -440,7 +440,7 @@ class Particles(ParticleSystem):
segIdList = eval('['+cim.getSegmentIdList().replace(' ',', ')+']')
for sid in segIdList:
seg = cim.getSegment(sid)
if( seg.isEnabled() ):
if seg.isEnabled():
t_b = seg.getTimeBegin()
t_e = seg.getTimeEnd()
fun = seg.getFunction()

View File

@ -599,7 +599,7 @@ class ShowBase(DirectObject.DirectObject):
# Temporary try..except for old pandas.
try:
self.render.node().setAttrib(RescaleNormalAttrib.makeDefault());
self.render.node().setAttrib(RescaleNormalAttrib.makeDefault())
except:
pass
@ -1304,8 +1304,8 @@ class ShowBase(DirectObject.DirectObject):
self.wireframeOn()
def wireframeOn(self):
self.render.setRenderModeWireframe(100);
self.render.setTwoSided(1);
self.render.setRenderModeWireframe(100)
self.render.setTwoSided(1)
self.wireframeEnabled = 1
def wireframeOff(self):

View File

@ -327,8 +327,8 @@ class QuadView(DirectObject.DirectObject):
def ToggleWire(self):
if (self.CurrentQuad==1): # Front View
if(self.FrontWire): # Wireframe is On so turn it off
self.FrontScene.setRenderModeWireframe(100);
self.FrontScene.setTwoSided(1);
self.FrontScene.setRenderModeWireframe(100)
self.FrontScene.setTwoSided(1)
self.FrontScene.setTextureOff(100)
self.FrontWire=0
else:
@ -339,8 +339,8 @@ class QuadView(DirectObject.DirectObject):
self.FrontWire=1
elif (self.CurrentQuad==2): # Front View
if(self.TopWire): # Wireframe is On so turn it off
self.TopScene.setRenderModeWireframe(100);
self.TopScene.setTwoSided(1);
self.TopScene.setRenderModeWireframe(100)
self.TopScene.setTwoSided(1)
self.TopScene.setTextureOff(100)
self.TopWire=0
else:
@ -351,8 +351,8 @@ class QuadView(DirectObject.DirectObject):
self.TopWire=1
elif (self.CurrentQuad==3): # Front View
if(self.LeftWire): # Wireframe is On so turn it off
self.LeftScene.setRenderModeWireframe(100);
self.LeftScene.setTwoSided(1);
self.LeftScene.setRenderModeWireframe(100)
self.LeftScene.setTwoSided(1)
self.LeftScene.setTextureOff(100)
self.LeftWire=0
else:
@ -363,8 +363,8 @@ class QuadView(DirectObject.DirectObject):
self.LeftWire=1
elif (self.CurrentQuad==4): # Front View
if(self.PerspectiveWire): # Wireframe is On so turn it off
self.PerspectiveScene.setRenderModeWireframe(100);
self.PerspectiveScene.setTwoSided(1);
self.PerspectiveScene.setRenderModeWireframe(100)
self.PerspectiveScene.setTwoSided(1)
self.PerspectiveScene.setTextureOff(100)
self.PerspectiveWire=0
else:
@ -379,28 +379,28 @@ class QuadView(DirectObject.DirectObject):
if (self.CurrentQuad==1): # Front View
if(self.FrontTexture): # Texture is on so turn it off
self.FrontScene.setTextureOff(100)
self.FrontTexture=0;
self.FrontTexture=0
else:
self.FrontScene.clearTexture()
self.FrontTexture=1
elif (self.CurrentQuad==2): # Top View
if(self.TopTexture): # Texture is on so turn it off
self.TopScene.setTextureOff(100)
self.TopTexture=0;
self.TopTexture=0
else:
self.TopScene.clearTexture()
self.TopTexture=1
elif (self.CurrentQuad==3): # Left View
if(self.LeftTexture): # Texture is on so turn it off
self.LeftScene.setTextureOff(100)
self.LeftTexture=0;
self.LeftTexture=0
else:
self.LeftScene.clearTexture()
self.LeftTexture=1
elif (self.CurrentQuad==4): # Perspective View
if(self.PerspectiveTexture): # Texture is on so turn it off
self.PerspectiveScene.setTextureOff(100)
self.PerspectiveTexture=0;
self.PerspectiveTexture=0
else:
self.PerspectiveScene.clearTexture()
self.PerspectiveTexture=1

View File

@ -170,7 +170,7 @@ class FileSaver:
if(not oldFilename.isRegularFile()):
if(texfilename.resolveFilename(getTexturePath(),"")):
oldFilename=texfilename
oldtexpath=oldFilename.toOsSpecific();
oldtexpath=oldFilename.toOsSpecific()
newtexpath=dirname + "/" + texfilename.getBasename()
newtexpathF=Filename(newtexpath)
@ -299,7 +299,7 @@ class FileSaver:
if(not oldFilename.isRegularFile()):
if(texfilename.resolveFilename(getTexturePath(),"")):
oldFilename=texfilename
oldtexpath=oldFilename.toOsSpecific();
oldtexpath=oldFilename.toOsSpecific()
newtexpath=dirname + "/" + texfilename.getBasename()

View File

@ -641,7 +641,7 @@ if sys.platform == "win32" and DIRECTXSDK is None:
MAYAVERSIONS=[("MAYA5", "SOFTWARE\\Alias|Wavefront\\Maya\\5.0\\Setup\\InstallPath"),
("MAYA6", "SOFTWARE\\Alias|Wavefront\\Maya\\6.0\\Setup\\InstallPath"),
("MAYA65", "SOFTWARE\\Alias|Wavefront\\Maya\\6.5\\Setup\\InstallPath")
];
]
for (ver,key) in MAYAVERSIONS:
if (OMIT.count(ver)==0) and (MAYASDK.has_key(ver)==0):