#NEWLINE# def __repr__( self ) : #NEWLINE# #INDENT# lst = [ ] #NEWLINE# for ( num , layer ) in self . num2layer . items ( ) : #NEWLINE# #INDENT# if ( ( layer in self . layer2num ) and ( self . layer2num [ layer ] == num ) ) : #NEWLINE# #INDENT# dir = '<->' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# dir = ' ->' #NEWLINE# #UNINDENT# lst . append ( ( num , ( '%#6x %s %-20s (%s)' % ( num , dir , layer . __name__ , layer . name ) ) ) ) #NEWLINE# #UNINDENT# for ( layer , num ) in self . layer2num . items ( ) : #NEWLINE# #INDENT# if ( ( num not in self . num2layer ) or ( self . num2layer [ num ] != dir ) ) : #NEWLINE# #INDENT# lst . append ( ( num , ( '%#6x <-  %-20s (%s)' % ( num , layer . __name__ , layer . name ) ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# lst . sort ( ) #NEWLINE# return '\n' . join ( ( y for ( x , y ) in lst ) )