#NEWLINE# def dict_repr( self , d , recursive , limit = 5 ) : #NEWLINE# #INDENT# if recursive : #NEWLINE# #INDENT# return _add_subclass_info ( '{...}' , d , dict ) #NEWLINE# #UNINDENT# buf = [ '{' ] #NEWLINE# have_extended_section = False #NEWLINE# for ( idx , ( key , value ) ) in enumerate ( iteritems ( d ) ) : #NEWLINE# #INDENT# if idx : #NEWLINE# #INDENT# buf . append ( ', ' ) #NEWLINE# #UNINDENT# if ( idx == ( limit - 1 ) ) : #NEWLINE# #INDENT# buf . append ( '<span class="extended">' ) #NEWLINE# have_extended_section = True #NEWLINE# #UNINDENT# buf . append ( ( '<span class="pair"><span class="key">%s</span>: <span class="value">%s</span></span>' % ( self . repr ( key ) , self . repr ( value ) ) ) ) #NEWLINE# #UNINDENT# if have_extended_section : #NEWLINE# #INDENT# buf . append ( '</span>' ) #NEWLINE# #UNINDENT# buf . append ( '}' ) #NEWLINE# return _add_subclass_info ( '' . join ( buf ) , d , dict )