#NEWLINE# def _align_styles( self ) : #NEWLINE# #INDENT# Utility . YOLO = True #NEWLINE# items = dict ( [ ( x , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) for x in Workbook . STYLE_ATTRIBUTE_MAP . keys ( ) ] ) #NEWLINE# styles = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for ( index , style ) in enumerate ( self . _styles ) : #NEWLINE# #INDENT# if ( not style . is_default ) : #NEWLINE# #INDENT# styles [ style ] = styles . get ( style , ( len ( styles ) + 1 ) ) #NEWLINE# setattr ( style , Workbook . STYLE_ID_ATTRIBUTE , styles [ style ] ) #NEWLINE# #UNINDENT# #UNINDENT# for style in styles . keys ( ) : #NEWLINE# #INDENT# for ( attr , attr_id ) in Workbook . STYLE_ATTRIBUTE_MAP . items ( ) : #NEWLINE# #INDENT# obj = getattr ( style , attr_id ) #NEWLINE# if ( obj and ( not obj . is_default ) ) : #NEWLINE# #INDENT# items [ attr ] [ obj ] = items [ attr ] . get ( obj , ( len ( items [ attr ] ) + 1 ) ) #NEWLINE# obj . id = items [ attr ] [ obj ] #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# for ( k , v ) in items . items ( ) : #NEWLINE# #INDENT# items [ k ] = [ tup [ 0 ] for tup in sorted ( v . items ( ) , key = ( lambda x : x [ 1 ] ) ) ] #NEWLINE# #UNINDENT# self . _items = items #NEWLINE# self . _styles = [ tup [ 0 ] for tup in sorted ( styles . items ( ) , key = ( lambda x : x [ 1 ] ) ) ] #NEWLINE# Utility . YOLO = False