code: def set_status(self, action, target):
          
          try:
              target = unquote(target)
          except (AttributeError, TypeError):
              pass
  
          status = "%s (%s) %s" % (self.domain, action, target)
          status = status.strip().replace('\n', '')
  
          if len(status) >= self.MAXWIDTH:
              tail = '...'
              extent = self.MAXWIDTH - (len(tail) + self.RPAD)
              self.status = status[:extent] + tail
          else:
              self.status = status
docs: Sets query status with format: "{domain} ({action}) {target}"