Package gnue :: Package common :: Package apps :: Module GConfig :: Class GConfig
[show private | hide private]

Class GConfig


Configuration manager for GNU Enterprise Applications
Method Summary
  __init__(self, section, defaults, configFilename, homeConfigDir)
  gConfig(self, var_name, configFilename, section)
This method is deprecated.
  gconfig(self, var_name, config_filename, section)
Retrieve an option from a section in a configuration file
dict gconfig_dict(self, config_filename, section)
Build a dictionary containing all configuration options of a given section within a given configuration file.
  gConfigDict(self, configFilename, section)
This method is deprecated.
  load_application_config(self, config_filename, home_config_dir, section, defaults)
Load the specified file only once.
  loadApplicationConfig(self, configFilename, homeConfigDir, section, defaults)
This method is deprecated.
  register_alias(self, name, section)
Register an alias for retrieving options of a given section in the configration file.
  registerAlias(self, name, section)
This method is deprecated.

Method Details

__init__(self, section, defaults=None, configFilename='gnue.conf', homeConfigDir='.gnue')
(Constructor)

gConfig(self, var_name, configFilename=None, section=None)

This method is deprecated. Please use gconfig() instead.

gconfig(self, var_name, config_filename=None, section=None)

Retrieve an option from a section in a configuration file
Parameters:
var_name - name of the option to retrieve
           (type=string)
config_filename - name of the configuration file to retrieve the option from. If None, the default configuration file will be used.
           (type=string)
section - name of the section to retrieve the option from. If None, the default section will be used.
Returns:
the retrieve option value

gconfig_dict(self, config_filename=None, section=None)

Build a dictionary containing all configuration options of a given section within a given configuration file.
Parameters:
config_filename - name of the configuration file to retrieve the options from. If None, the default configuration file will be used.
           (type=string)
section - name of the section to retrieve the options from. If None, the default section will be used.
Returns:
dictionary containing the options and their values
           (type=dict)

gConfigDict(self, configFilename=None, section=None)

This method is deprecated. Please use gconfig_dict() instead.

load_application_config(self, config_filename='gnue.conf', home_config_dir='.gnue', section='DEFAULT', defaults=None)

Load the specified file only once. Subsequent calls setup the defaults for any missing values.
Raises:
InvalidFormatError - if parsing of the configuration file fails, this error will indicate why.

loadApplicationConfig(self, configFilename='gnue.conf', homeConfigDir='.gnue', section='DEFAULT', defaults=None)

This method is deprecated. Please use load_application_config() instead.

register_alias(self, name, section)

Register an alias for retrieving options of a given section in the configration file.
Parameters:
name - function name to use as a 'builtin' for retrieving options of the given section
           (type=string)
section - the section of which option values should be read
           (type=string)

registerAlias(self, name, section)

This method is deprecated. Please use register_alias() instead


GNUe Home

Public API

Developer's Corner