#NEWLINE# def __format__( self , fmt_spec = '' ) : #NEWLINE# #INDENT# if fmt_spec . endswith ( 'h' ) : #NEWLINE# #INDENT# fmt_spec = fmt_spec [ : ( - 1 ) ] #NEWLINE# coords = itertools . chain ( [ abs ( self ) ] , self . angles ( ) ) #NEWLINE# outer_fmt = '<{}>' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# coords = self #NEWLINE# outer_fmt = '({})' #NEWLINE# #UNINDENT# components = ( format ( c , fmt_spec ) for c in coords ) #NEWLINE# return outer_fmt . format ( ', ' . join ( fmt_spec ) )