#NEWLINE# def get_rendered_map( self ) : #NEWLINE# #INDENT# items = self . get_all ( ) #NEWLINE# if self . renderer : #NEWLINE# #INDENT# rendered = self . renderer ( items . values ( ) , as_map = True ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# rendered = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# rendered_out = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for ( key , value ) in items . iteritems ( ) : #NEWLINE# #INDENT# if ( type ( value ) is list ) : #NEWLINE# #INDENT# value = str ( value ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# value = str ( value . encode ( 'utf-8' ) ) #NEWLINE# #UNINDENT# u_key = ( unicode ( key , 'utf-8' ) if ( not isinstance ( rendered , unicode ) ) else key ) #NEWLINE# u_val = ( unicode ( value , 'utf-8' ) if ( not isinstance ( value , unicode ) ) else value ) #NEWLINE# rendered_val = ( rendered . get ( value ) if rendered else value ) #NEWLINE# u_rendered = ( unicode ( rendered_val , 'utf-8' ) if ( not isinstance ( rendered_val , unicode ) ) else rendered_val ) #NEWLINE# rendered_out [ u_key ] = ( u_val , u_rendered ) #NEWLINE# #UNINDENT# return rendered_out