code: def attach(self, screen):
          
          if self.listener is not None:
              warnings.warn("As of version 0.6.0 the listener queue is "
                            "restricted to a single element. Existing "
                            "listener {0} will be replaced."
                            .format(self.listener), DeprecationWarning)
  
          if self.strict:
              for event in self.events:
                  if not hasattr(screen, event):
                      raise TypeError("{0} is missing {1}".format(screen, event))
  
          self.listener = screen
          self._parser = None
          self._initialize_parser()
docs: Adds a given screen to the listener queue.
  
          :param pyte.screens.Screen screen: a screen to attach to.