DistributedObject.py 851 B

123456789101112131415161718192021222324252627282930313233
  1. """DistributedObject module: contains the DistributedObject class"""
  2. from PandaObject import *
  3. from ToonBaseGlobal import *
  4. class DistributedObject(PandaObject):
  5. """Distributed Object class:"""
  6. def __init__(self, cr):
  7. try:
  8. self.DistributedObject_initialized
  9. except:
  10. self.DistributedObject_initialized = 1
  11. self.cr = cr
  12. return None
  13. def getDoId(self):
  14. """getDoId(self)
  15. Return the distributed object id
  16. """
  17. return self.doId
  18. def updateRequiredFields(self, cdc, di):
  19. for i in cdc.allRequiredCDU:
  20. i.updateField(cdc, self, di)
  21. def sendUpdate(self, fieldName, args):
  22. self.cr.sendUpdate(self, fieldName, args)
  23. def taskName(self, taskString):
  24. return (taskString + "-" + str(self.getDoId))