#NEWLINE# def load_ini( self , ini_config ) : #NEWLINE# #INDENT# '\n        Read the provided ini contents arguments and merge\n        the data in the ini config into the config object.\n\n        ini_config is assumed to be a string of the ini file contents.\n        ' #NEWLINE# parser = ConfigParser ( ) #NEWLINE# parser . readfp ( StringIO ( ini_config ) ) #NEWLINE# data = { #NEWLINE# #INDENT# 'linters' : { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , #NEWLINE# 'files' : { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , #NEWLINE# 'branches' : { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# if parser . has_section ( 'files' ) : #NEWLINE# #INDENT# ignore = parser . get ( 'files' , 'ignore' ) #NEWLINE# data [ 'files' ] [ 'ignore' ] = newline_value ( ignore ) #NEWLINE# #UNINDENT# if parser . has_section ( 'branches' ) : #NEWLINE# #INDENT# ignore = parser . get ( 'branches' , 'ignore' ) #NEWLINE# data [ 'branches' ] [ 'ignore' ] = comma_value ( ignore ) #NEWLINE# #UNINDENT# linters = [ ] #NEWLINE# if parser . has_section ( 'tools' ) : #NEWLINE# #INDENT# linters = comma_value ( parser . get ( 'tools' , 'linters' ) ) #NEWLINE# #UNINDENT# for linter in linters : #NEWLINE# #INDENT# data [ 'linters' ] [ linter ] = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# for section in parser . sections ( ) : #NEWLINE# #INDENT# if ( not section . startswith ( 'tool_' ) ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# linter = section [ 5 : ] #NEWLINE# data [ 'linters' ] [ linter ] = dict ( parser . items ( section ) ) #NEWLINE# #UNINDENT# self . update ( data )