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 addInbox(self, *args): """ Allocates a new inbox 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 inbox added. """ name = self._newInboxName(*args) self.inboxes[name] = makeInbox(self.unpause) return name
def addInbox(self,*args): """ Allocates a new inbox 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 inbox added. """ name = self._newInboxName(*args) self.inboxes[name]=makeInbox(self.unpause) return name