#NEWLINE# def pretty( self , indent = 0 ) : #NEWLINE# #INDENT# indent = ( indent * ' ' ) #NEWLINE# lines = list ( ) #NEWLINE# version_string = '{v.major}.{v.minor}' . format ( v = self . version ) #NEWLINE# lines . append ( ( 'handover version' , version_string ) ) #NEWLINE# if self . error . reason : #NEWLINE# #INDENT# lines . append ( ( 'error reason' , self . error . reason ) ) #NEWLINE# lines . append ( ( 'error value' , self . error . value ) ) #NEWLINE# #UNINDENT# for ( index , carrier ) in enumerate ( self . carriers ) : #NEWLINE# #INDENT# lines . append ( ( 'carrier {0}:' . format ( ( index + 1 ) ) , ) ) #NEWLINE# reference = carrier . carrier_data_reference #NEWLINE# lines . append ( ( ( indent + 'reference' ) , repr ( reference ) ) ) #NEWLINE# lines . append ( ( ( indent + 'power state' ) , carrier . carrier_power_state ) ) #NEWLINE# if ( len ( carrier . auxiliary_data_reference_list ) > 0 ) : #NEWLINE# #INDENT# lines . append ( ( ( indent + 'auxiliary data' ) , ) ) #NEWLINE# for aux_data_ref in carrier . auxiliary_data_reference_list : #NEWLINE# #INDENT# lines . append ( ( ( ( 2 * indent ) + 'reference' ) , repr ( aux_data_ref ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# lwidth = max ( [ len ( line [ 0 ] ) for line in lines ] ) #NEWLINE# lines = [ ( ( line [ 0 ] . ljust ( lwidth ) , ) + line [ 1 : ] ) for line in lines ] #NEWLINE# lines = [ ' = ' . join ( line ) for line in lines ] #NEWLINE# return '\n' . join ( [ ( indent + line ) for line in lines ] )