示例#1
0
 def message(self, mesg, recipient, method="PRIVMSG"):
     """
     Send a message.
     """
     msg = lineify(str(mesg))
     self.history[self.lower(recipient)] = msg
     for message in [i for i in msg if i]:
         self.put(self.pack(message, recipient, method))
     return mesg  # Debugging
示例#2
0
文件: button.py 项目: svkampen/Karkat
    def fancydisplay(self, chan):
        button = """╔═══╕ %s
║ 04● │ %s
╙───┘ Will you press the button?"""
        k = 48
        while True:
            text = lineify(self.active.setdefault(chan, ""), k)
            k += 8
            if len(text) < 3: break
        if len(text) == 1: text.append("")
        return button % tuple(text)