#NEWLINE# def map_color( text , key = 'fontcolor' ) : #NEWLINE# #INDENT# "Map the text to a color.\n\n    The text is mapped to a color.\n\n    :param text: string of text to be mapped to a color. 'error' and\n                 'fail' in the text will map to 'red'.\n    :param key: in returned dictionary, the key to use that corresponds to\n                the color\n    :returns: A dictionary with one entry, key = color. If no color is\n              associated with the text, an empty dictionary.\n    " #NEWLINE# if ( ( 'error' in key ) or ( 'fail' in text ) ) : #NEWLINE# #INDENT# return { #NEWLINE# #INDENT# key : 'red' , #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# }