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)
def __init__(self): from cia.LibCIA.IRC.Formatting import ColortextFormatter self.formatter = ColortextFormatter()