#NEWLINE# def render( self , name , value , attrs ) : #NEWLINE# #INDENT# encoded = value #NEWLINE# if ( not is_password_usable ( encoded ) ) : #NEWLINE# #INDENT# return 'None' #NEWLINE# #UNINDENT# final_attrs = self . build_attrs ( attrs ) #NEWLINE# encoded = smart_str ( encoded ) #NEWLINE# if ( ( len ( encoded ) == 32 ) and ( '$' not in encoded ) ) : #NEWLINE# #INDENT# algorithm = 'unsalted_md5' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# algorithm = encoded . split ( '$' , 1 ) [ 0 ] #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# hasher = get_hasher ( algorithm ) #NEWLINE# #UNINDENT# except ValueError : #NEWLINE# #INDENT# summary = '<strong>Invalid password format or unknown hashing algorithm.</strong>' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# summary = '' #NEWLINE# for ( key , value ) in hasher . safe_summary ( encoded ) . iteritems ( ) : #NEWLINE# #INDENT# summary += ( '<strong>%(key)s</strong>: %(value)s ' % { #NEWLINE# #INDENT# 'key' : ugettext ( key ) , #NEWLINE# 'value' : value , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# #UNINDENT# return mark_safe ( ( '<div%(attrs)s>%(summary)s</div>' % { #NEWLINE# #INDENT# 'attrs' : flatatt ( final_attrs ) , #NEWLINE# 'summary' : summary , #NEWLINE# #UNINDENT# } ) )