protect against calling announceGenerate() and disable() twice

This commit is contained in:
David Rose 2005-01-10 17:31:08 +00:00
parent df408c942f
commit 3f42589532

View File

@ -143,20 +143,22 @@ class DistributedObject(PandaObject):
generated and all of its required fields filled in. generated and all of its required fields filled in.
""" """
assert(self.notify.debug('announceGenerate(): %s' % (self.doId))) assert(self.notify.debug('announceGenerate(): %s' % (self.doId)))
self.activeState = ESGenerated if self.activeState != ESGenerated:
messenger.send(self.uniqueName("generate"), [self]) self.activeState = ESGenerated
messenger.send(self.uniqueName("generate"), [self])
def disable(self): def disable(self):
""" """
Inheritors should redefine this to take appropriate action on disable Inheritors should redefine this to take appropriate action on disable
""" """
assert(self.notify.debug('disable(): %s' % (self.doId))) assert(self.notify.debug('disable(): %s' % (self.doId)))
self.activeState = ESDisabled if self.activeState != ESDisabled:
self.__callbacks = {} self.activeState = ESDisabled
if wantOtpServer: self.__callbacks = {}
self.cr.deleteObjectLocation(self.doId, self.__location[0], self.__location[1]) if wantOtpServer:
self.__location = (None, None) self.cr.deleteObjectLocation(self.doId, self.__location[0], self.__location[1])
# TODO: disable my children self.__location = (None, None)
# TODO: disable my children
def isDisabled(self): def isDisabled(self):
""" """