#NEWLINE# def load( self , path ) : #NEWLINE# #INDENT# ret = None #NEWLINE# logger . info ( 'to load: [{0}]' . format ( path ) ) #NEWLINE# ( _ , ext ) = os . path . splitext ( self . base_path ) #NEWLINE# ( _ , ext ) = ( os . path . splitext ( path ) if ( ext == '' ) else ( None , ext ) ) #NEWLINE# ext = ( '.json' if ( path == '' ) else ext ) #NEWLINE# if ( not path . endswith ( ext ) ) : #NEWLINE# #INDENT# path = ( path + ext ) #NEWLINE# #UNINDENT# if ( ( os . name == 'nt' ) and path . startswith ( '/' ) ) : #NEWLINE# #INDENT# path = path [ 1 : ] #NEWLINE# #UNINDENT# logger . info ( 'final path to load: [{0}]' . format ( path ) ) #NEWLINE# with open ( path , 'r' ) as f : #NEWLINE# #INDENT# ret = f . read ( ) #NEWLINE# #UNINDENT# return ret