#NEWLINE# def read_properties( self , filename , section = None ) : #NEWLINE# #INDENT# if ( not section ) : #NEWLINE# #INDENT# basename = os . path . basename ( filename ) #NEWLINE# if basename . endswith ( '.properties' ) : #NEWLINE# #INDENT# section = basename [ : ( - 11 ) ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# section = basename #NEWLINE# #UNINDENT# #UNINDENT# data = StringIO ( ) #NEWLINE# data . write ( ( '[%s]\n' % section ) ) #NEWLINE# with codecs . open ( f , encoding = 'utf-8' ) as f : #NEWLINE# #INDENT# data . write ( f . read ( ) ) #NEWLINE# #UNINDENT# data . seek ( 0 , os . SEEK_SET ) #NEWLINE# self . readfp ( data )