xoa.cfgm

Configuration management utilities based on configobj

Usage

See the Config management with xoa.cfgm section.

Functions

cfg2rst(cfg[, mode, optrole, secrole])

Convert a configuration to rst format

cfgargparse(cfgspecfile, parser[, parse, ...])

Merge configuration and commandline arguments

filter_section(sec, cfgfilter[, default])

Recursively filter a section according to a dict of specifications

gen_cfgm_cfg(app)

gen_cfgm_rst(app)

get_cfg_path(cfg[, entry, sep])

Get a string representing the path of a ConfigObj through sections

get_sec_names(cfg)

Get section names as list from top to bottom ['sec0','sec1',...]

get_spec(spec[, validator])

Get an option specification

get_validator([functions, cls])

Get a default validator

is_bbox(value[, default])

Parse bbox coordinates with value format: x1,y1,x2,y2

is_boolstr(value[, default])

Validation function of a boolean or a string

is_cdtime(value[, min, max, default])

Validation function of a date (compatible with cdtime.s2c())

is_cmap(value[, default])

Validation function that return a :xoa.color.CmapAdapter

is_color(value[, default, alpha, as256])

Validate a matplotlib compatible color

is_daterange(value[, default])

Validation function of a pandas.date_range()

is_daterange64(value[, default])

Validation function of a date range created with numpy.arange()

is_datetime(value[, default])

Validation function to magically create a datetime.datetime

is_datetime64(value[, default])

Validation function to create a numpy.datetime64

is_dict(value[, default, vtype])

Validation function for dictionaries

is_eval(value[, default, unchanged_if_failed])

Validate a string that can be evaluated

is_figsize(value[, default, min, max])

Validation function of a figure size (xsize,ysize)

is_interval(value[, default])

Validation function of an interval of coordinates (min,max[,bounds])

is_minmax(value[, min, max, default, type])

Validation function of a min,max pair

is_numerics(value[, default, min, max, type, n])

Validation function of a tuple of numeric values

is_path(value[, default, expand])

Parse a value as a path

is_pydatetime(value[, default, fmt])

Parse value as a datetime.datetime object

is_timedelta(value[, default])

Validation function of date as parsable by pandas.Timedelta()

is_timedelta64(value[, default])

Validation function of date as parsable by numpy.timedelta64()

is_timestamp(value[, default])

Validation function of date as parsable by pandas.Timestamp()

opt2rst(shelp[, prog, secfmt, descname])

Convert --help str to rst

parse_node(env, sig, signode)

print_short_help(parser[, formatter, compressed])

Print all help of a parser instance but those of groups

print_validation_functions([pattern])

Print available xoa validator functions

register_validation_functions(**kwargs)

Add a new configobj validator functions

remove_defaults(cfg)

setup(app)

Classes

ConfigManager([cfgspecfile, validator, ...])

A configuration management class based on configobj

Exceptions

VdtDateTimeError

VdtSizeError

List size is incorrect (nmin, nmax, odd, even or shape)

VdtWarning

XoaValidateError