mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -04:00
Readability
This commit is contained in:
parent
0ecf5adfbb
commit
b58c2981d1
@ -18,7 +18,7 @@ class DistributedObjectUD(DistributedObjectBase):
|
|||||||
self.DistributedObjectUD_initialized = 1
|
self.DistributedObjectUD_initialized = 1
|
||||||
DistributedObjectBase.__init__(self, air)
|
DistributedObjectBase.__init__(self, air)
|
||||||
|
|
||||||
self.accountName=''
|
self.accountName = ''
|
||||||
# Record the repository
|
# Record the repository
|
||||||
self.air = air
|
self.air = air
|
||||||
|
|
||||||
@ -55,22 +55,21 @@ class DistributedObjectUD(DistributedObjectBase):
|
|||||||
and conditionally show generated, disabled, neverDisable,
|
and conditionally show generated, disabled, neverDisable,
|
||||||
or cachable
|
or cachable
|
||||||
"""
|
"""
|
||||||
spaces=' '*(indent+2)
|
spaces = ' ' * (indent + 2)
|
||||||
try:
|
try:
|
||||||
print "%s%s:"%(
|
print "%s%s:" % (' ' * indent, self.__class__.__name__)
|
||||||
' '*indent, self.__class__.__name__)
|
print ("%sfrom "
|
||||||
print "%sfrom DistributedObject doId:%s, parent:%s, zone:%s"%(
|
"DistributedObject doId:%s, parent:%s, zone:%s" %
|
||||||
spaces,
|
(spaces, self.doId, self.parentId, self.zoneId)),
|
||||||
self.doId, self.parentId, self.zoneId),
|
flags = []
|
||||||
flags=[]
|
|
||||||
if self.__generated:
|
if self.__generated:
|
||||||
flags.append("generated")
|
flags.append("generated")
|
||||||
if self.air == None:
|
if self.air == None:
|
||||||
flags.append("deleted")
|
flags.append("deleted")
|
||||||
if len(flags):
|
if len(flags):
|
||||||
print "(%s)"%(" ".join(flags),),
|
print "(%s)" % (" ".join(flags),),
|
||||||
print
|
print
|
||||||
except Exception, e: print "%serror printing status"%(spaces,), e
|
except Exception, e: print "%serror printing status" % (spaces,), e
|
||||||
|
|
||||||
def getDeleteEvent(self):
|
def getDeleteEvent(self):
|
||||||
# this is sent just before we get deleted
|
# this is sent just before we get deleted
|
||||||
@ -230,6 +229,7 @@ class DistributedObjectUD(DistributedObjectBase):
|
|||||||
# arguments are newZoneId, oldZoneId
|
# arguments are newZoneId, oldZoneId
|
||||||
# includes the quiet zone.
|
# includes the quiet zone.
|
||||||
return 'DOChangeZone-%s' % self.doId
|
return 'DOChangeZone-%s' % self.doId
|
||||||
|
|
||||||
def getLogicalZoneChangeEvent(self):
|
def getLogicalZoneChangeEvent(self):
|
||||||
# this event is generated whenever this object changes to a
|
# this event is generated whenever this object changes to a
|
||||||
# non-quiet-zone zone.
|
# non-quiet-zone zone.
|
||||||
@ -283,8 +283,8 @@ class DistributedObjectUD(DistributedObjectBase):
|
|||||||
# have we already allocated a doId?
|
# have we already allocated a doId?
|
||||||
if self.__preallocDoId:
|
if self.__preallocDoId:
|
||||||
self.__preallocDoId = 0
|
self.__preallocDoId = 0
|
||||||
return self.generateWithRequiredAndId(
|
return self.generateWithRequiredAndId(self.doId, zoneId,
|
||||||
self.doId, zoneId, optionalFields)
|
optionalFields)
|
||||||
|
|
||||||
# The repository is the one that really does the work
|
# The repository is the one that really does the work
|
||||||
parentId = self.air.districtId
|
parentId = self.air.districtId
|
||||||
@ -315,7 +315,7 @@ class DistributedObjectUD(DistributedObjectBase):
|
|||||||
# have we already allocated a doId?
|
# have we already allocated a doId?
|
||||||
if self.__preallocDoId:
|
if self.__preallocDoId:
|
||||||
assert doId is None or doId == self.__preallocDoId
|
assert doId is None or doId == self.__preallocDoId
|
||||||
doId=self.__preallocDoId
|
doId = self.__preallocDoId
|
||||||
self.__preallocDoId = 0
|
self.__preallocDoId = 0
|
||||||
|
|
||||||
# Assign it an id
|
# Assign it an id
|
||||||
@ -324,7 +324,7 @@ class DistributedObjectUD(DistributedObjectBase):
|
|||||||
else:
|
else:
|
||||||
self.doId = doId
|
self.doId = doId
|
||||||
# Put the new DO in the dictionaries
|
# Put the new DO in the dictionaries
|
||||||
self.air.addDOToTables(self, location=(parentId, zoneId))
|
self.air.addDOToTables(self, location = (parentId, zoneId))
|
||||||
# Send a generate message
|
# Send a generate message
|
||||||
self.sendGenerateWithRequired(self.air, parentId, zoneId, optionalFields)
|
self.sendGenerateWithRequired(self.air, parentId, zoneId, optionalFields)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user