#NEWLINE# def _write_number_formats( self ) : #NEWLINE# #INDENT# number_format_table = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# number_format_list = [ ] #NEWLINE# exceptions_list = [ ] #NEWLINE# num_fmt_id = 165 #NEWLINE# num_fmt_offset = 0 #NEWLINE# for style in self . _style_list : #NEWLINE# #INDENT# if ( not ( style . number_format in number_format_list ) ) : #NEWLINE# #INDENT# number_format_list . append ( style . number_format ) #NEWLINE# #UNINDENT# #UNINDENT# for number_format in number_format_list : #NEWLINE# #INDENT# if number_format . is_builtin ( ) : #NEWLINE# #INDENT# btin = number_format . builtin_format_id ( number_format . format_code ) #NEWLINE# number_format_table [ number_format ] = btin #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# number_format_table [ number_format ] = ( num_fmt_id + num_fmt_offset ) #NEWLINE# num_fmt_offset += 1 #NEWLINE# exceptions_list . append ( number_format ) #NEWLINE# #UNINDENT# #UNINDENT# num_fmts = SubElement ( self . _root , 'numFmts' , { #NEWLINE# #INDENT# 'count' : ( '%d' % len ( exceptions_list ) ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# for number_format in exceptions_list : #NEWLINE# #INDENT# SubElement ( num_fmts , 'numFmt' , { #NEWLINE# #INDENT# 'numFmtId' : ( '%d' % number_format_table [ number_format ] ) , #NEWLINE# 'formatCode' : ( '%s' % number_format . format_code ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# return number_format_table