#NEWLINE# def _prepare_fills( self ) : #NEWLINE# #INDENT# fills = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# index = 2 #NEWLINE# fills [ '0:0:0' ] = 0 #NEWLINE# fills [ '17:0:0' ] = 1 #NEWLINE# for xf_format in self . dxf_formats : #NEWLINE# #INDENT# if ( xf_format . pattern or xf_format . bg_color or xf_format . fg_color ) : #NEWLINE# #INDENT# xf_format . has_dxf_fill = 1 #NEWLINE# xf_format . dxf_bg_color = xf_format . bg_color #NEWLINE# xf_format . dxf_fg_color = xf_format . fg_color #NEWLINE# #UNINDENT# #UNINDENT# for xf_format in self . xf_formats : #NEWLINE# #INDENT# if ( ( xf_format . pattern == 1 ) and ( xf_format . bg_color != 0 ) and ( xf_format . fg_color != 0 ) ) : #NEWLINE# #INDENT# tmp = xf_format . fg_color #NEWLINE# xf_format . fg_color = xf_format . bg_color #NEWLINE# xf_format . bg_color = tmp #NEWLINE# #UNINDENT# if ( ( xf_format . pattern <= 1 ) and ( xf_format . bg_color != 0 ) and ( xf_format . fg_color == 0 ) ) : #NEWLINE# #INDENT# xf_format . fg_color = xf_format . bg_color #NEWLINE# xf_format . bg_color = 0 #NEWLINE# xf_format . pattern = 1 #NEWLINE# #UNINDENT# if ( ( xf_format . pattern <= 1 ) and ( xf_format . bg_color == 0 ) and ( xf_format . fg_color != 0 ) ) : #NEWLINE# #INDENT# xf_format . bg_color = 0 #NEWLINE# xf_format . pattern = 1 #NEWLINE# #UNINDENT# key = xf_format . _get_fill_key ( ) #NEWLINE# if ( key in fills ) : #NEWLINE# #INDENT# xf_format . fill_index = fills [ key ] #NEWLINE# xf_format . has_fill = 0 #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# fills [ key ] = index #NEWLINE# xf_format . fill_index = tmp #NEWLINE# xf_format . has_fill = 1 #NEWLINE# index += 1 #NEWLINE# #UNINDENT# #UNINDENT# self . fill_count = index