def parse_irc_colors(string):
 in_string = utils.to_str(string)
 parsed_string = ''
 parts = (RE_ANSI_ESCAPES.split(in_string) + [' '])
 for (part, sep) in zip(parts[::2], parts[1::2]):
  pstring = RE_IRC_COLOR.sub(sub_irc, part)
  parsed_string += ('%s%s' % (pstring, sep[0].strip()))
 parsed_string = RE_MXP.sub('\\2', parsed_string)
 return parsed_string

def parse_irc_colors ( string ) : in_string = utils . to_str ( string ) parsed_string = '' parts = ( RE_ANSI_ESCAPES . split ( in_string ) + [ ' ' ] ) for ( part , sep ) in zip ( parts [ : : 2 ] , parts [ 1 : : 2 ] ) : pstring = RE_IRC_COLOR . sub ( sub_irc , part ) parsed_string += ( '%s%s' % ( pstring , sep [ 0 ] . strip ( ) ) ) parsed_string = RE_MXP . sub ( '\\2' , parsed_string ) return parsed_string
parse {-type syntax and replace with irc color markers args: string : string to parse for irc colors .