#NEWLINE# def load_single_config( conf_parser , conf_key ) : #NEWLINE# #INDENT# config_warn_msg = 'Cannot load config [%s], use default value: %s' #NEWLINE# try : #NEWLINE# #INDENT# v = conf_parser . get ( 'settings' , conf_key ) #NEWLINE# if ( not v ) : #NEWLINE# #INDENT# raise Exception ( 'ConfigError' , 'invalid' ) #NEWLINE# #UNINDENT# gkey = var_dict [ conf_key ] [ 0 ] #NEWLINE# ty = var_dict [ conf_key ] [ 1 ] #NEWLINE# if ( ty == 'n' ) : #NEWLINE# #INDENT# globals ( ) [ gkey ] = int ( v ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( ty == 'p' ) : #NEWLINE# #INDENT# util . create_dir ( v ) #NEWLINE# #UNINDENT# globals ( ) [ gkey ] = v #NEWLINE# #UNINDENT# #UNINDENT# except : #NEWLINE# #INDENT# if ( not conf_key . find ( 'proxy.http' ) ) : #NEWLINE# #INDENT# log . warn ( ( config_warn_msg % ( conf_key , str ( globals ( ) [ var_dict [ conf_key ] [ 0 ] ] ) ) ) )