bashes.config module

Standardized handling of config info

class bashes.config.Config(args=None)

Bases: dict

Represents a dictionary of serializable configuration data.

save(name, noclobber=False)

Serializes this config to a YAML file using the specified base name. Will not overwrite an existing file if noclobber is True. The .yaml extension is added to name unless it already has an extension.

bashes.config.githash(what='HEAD')

Returns the hash for the HEAD of the git repo containing this file or a helpful error message string if this cannot be determined

bashes.config.load(name)

Loads and returns a dictionary for the named config. The .yaml extension is added to name unless it already has an extension. Note that the return value is a plain dict and not a Config object.