コード例 #1
0
ファイル: Component.py プロジェクト: thangduong/kamaelia
    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:
            if boxname != "control":
                self.inboxes[boxname] = makeInbox(notify=self.unpause)
            else:
                self.inboxes[boxname] = makeEventInbox(
                    notify=self.__receiveEvent)
        for boxname in self.Outboxes:
            self.outboxes[boxname] = makeOutbox(notify=self.unpause)

        self.children = []
        self._callOnCloseDown = []

        self.postoffice = postoffice("component :" + self.name)
コード例 #2
0
   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
コード例 #3
0
    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
コード例 #4
0
ファイル: Component.py プロジェクト: 3rdandUrban-dev/Nuxleus
   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)