#NEWLINE# def load_config( ) : #NEWLINE# #INDENT# ' Returns the config information ' #NEWLINE# _config_file = '{}/config.yaml' . format ( os . getenv ( 'POCS' , '/var/panoptes/POCS' ) ) #NEWLINE# _local_config_file = '{}/config_local.yaml' . format ( os . getenv ( 'POCS' , '/var/panoptes/POCS' ) ) #NEWLINE# _config = dict ( ) #NEWLINE# try : #NEWLINE# #INDENT# with open ( _config_file , 'r' ) as f : #NEWLINE# #INDENT# _config . update ( yaml . load ( f . read ( ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# except IOError as err : #NEWLINE# #INDENT# warnings . warn ( 'Cannot open config file. Please make sure $POCS environment variable is set: {}' . format ( _config_file ) ) #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# with open ( _local_config_file , 'r' ) as f : #NEWLINE# #INDENT# _config . update ( yaml . load ( f . read ( ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# except IOError as err : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# return _config