#NEWLINE# def render_prompt( self , prompt ) : #NEWLINE# #INDENT# 'Parses the `prompt` string and returns the rendered version' #NEWLINE# prompt = prompt . strip ( "'" ) . replace ( "\\'" , "'" ) #NEWLINE# for colour in ansi . COLOURS_NAMED : #NEWLINE# #INDENT# if ( ( '[%s]' % colour ) in prompt ) : #NEWLINE# #INDENT# prompt = prompt . replace ( ( '[%s]' % colour ) , ansiFormatter . cmdColourNamed ( colour ) ) #NEWLINE# #UNINDENT# #UNINDENT# prompt = prompt . replace ( '[R]' , ansiFormatter . cmdReset ( ) ) #NEWLINE# return prompt