def __init__(self, *args, **argd): """You want to overide this method locally. You MUST remember to call the superconstructor for things to work however. The way you do this is: super(YourClass,self).__init__() """ super(component, self).__init__() self.__dict__.update(argd) self.inboxes = dict() self.outboxes = dict() # Create boxes for inboxes/outboxes for boxname in self.Inboxes: self.inboxes[boxname] = makeInbox(notify=self.unpause) for boxname in self.Outboxes: self.outboxes[boxname] = makeOutbox(notify=self.unpause) self.children = [] self._callOnCloseDown = [] self.postoffice = postoffice("component :" + self.name) if TraceAllSends: self._o_send = self.send self.send = self._debug_send if TraceAllRecvs: self._o_recv = self.recv self.recv = self._debug_recv
def addOutbox(self, *args): """\ Allocates a new outbox with name *based on* the name provided. If a box with the suggested name already exists then a variant is used instead. Returns the name of the outbox added. """ name = self._newOutboxName(*args) self.outboxes[name] = makeOutbox(self.unpause) return name
def addOutbox(self,*args): """\ Allocates a new outbox with name *based on* the name provided. If a box with the suggested name already exists then a variant is used instead. Returns the name of the outbox added. """ name = self._newOutboxName(*args) self.outboxes[name]=makeOutbox(self.unpause) return name