Config#

The config gives access to the configuration.

trytond.config.get_hostname(netloc)#

Returns the hostname from the network location/authority of URI.

trytond.config.get_port(netloc)#

Returns the port from the network location/authority of URI.

trytond.config.split_netloc(netloc)#

Returns the couple hostname and port from the network location/authority of URI.

trytond.config.parse_listen(value)#

Yields couples of hostname and port from the comma separated list of network location/authority of URI.

trytond.config.parse_uri(uri)#

Parses a URI, returning a namedtuple.

trytond.config.update_etc([configfile])#

Tries to update the configuration with the file or list of files and returns the filenames which were successfully parsed.

trytond.config.has_section(section)#

Indicates whether the named section is present in the configuration.

trytond.config.add_section(section)#

Adds the named section.

trytond.config.remove_section(section)#

Removes the named section.

trytond.config.set(section, option[, value])#

Set the given option to the specified value.

trytond.config.get(section, option[, default])#

Get an option value for the named section. If the key is not found the default value is provided.

trytond.config.getint(section, option[, default])#

A convenience method which coerces the option in the specified section to an int. See get().

trytond.config.getfloat(section, option[, default])#

A convenience method which coerces the option in the specified section to a float. See get().

trytond.config.getboolean(section, option[, default])#

A convenience method which coerces the option in the specified section to a bool. See get().