#NEWLINE# def _get_db_settings( self ) : #NEWLINE# #INDENT# 'Create DB settings according to the configuration file.' #NEWLINE# config_path = os . path . expanduser ( self . config . FrameworkConfigGet ( 'DATABASE_SETTINGS_FILE' ) ) #NEWLINE# settings = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# with FileOperations . open ( config_path , 'r' ) as f : #NEWLINE# #INDENT# for line in f : #NEWLINE# #INDENT# line = line . rstrip ( ) #NEWLINE# if ( ( not line ) or line . startswith ( '#' ) ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# ( key , value ) = line . split ( ':' ) #NEWLINE# settings [ key . strip ( ) ] = value . strip ( ) #NEWLINE# #UNINDENT# except ValueError : #NEWLINE# #INDENT# self . error_handler . FrameworkAbort ( ( "Problem in config file: '%s' -> Cannot parse line: %s" % ( config_path , line ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return settings