示例#1
0
class ColortextToIRC(ColortextFormatter):
    """Converts messages with colorText content to plain text
       with IRC color tags.
       """
    medium = 'irc'
    color = True

    def param_noColor(self, tag):
        self.color = False

    def __init__(self):
        from cia.LibCIA.IRC.Formatting import ColortextFormatter
        self.formatter = ColortextFormatter()

    def format(self, args):
        colorText = XML.dig(args.message.xml, "message", "body", "colorText")
        if self.color:
            return self.formatter.parse(colorText)
        else:
            return XML.allText(colorText)
示例#2
0
 def __init__(self):
     from cia.LibCIA.IRC.Formatting import ColortextFormatter
     self.formatter = ColortextFormatter()