class documentation
class YAMLConfigFileParser(ConfigFileParser): (source)
Parses YAML config files. Depends on the PyYAML module. https://pypi.python.org/pypi/PyYAML
Method | get |
Returns a string describing the config file syntax. |
Method | parse |
Parses the keys and values from a config file. |
Method | serialize |
Does the inverse of config parsing by taking parsed values and converting them back to a string representing config file contents. |
Method | _load |
lazy-import PyYAML so that configargparse doesn't have to depend on it unless this parser is used. |
overrides
configargparse.ConfigFileParser.parse
Parses the keys and values from a config file.
NOTE: For keys that were specified to configargparse as action="store_true" or "store_false", the config file value must be one of: "yes", "no", "on", "off", "true", "false". Otherwise an error will be raised.
Parameters | |
stream:IO | A config file input stream (such as an open file object). |
Returns | |
OrderedDict | Items where the keys are strings and the values are either strings or lists (eg. to support config file formats like YAML which allow lists). |
Does the inverse of config parsing by taking parsed values and converting them back to a string representing config file contents.
Parameters | |
items | an OrderedDict of items to be converted to the config file format. Keys should be strings, and values should be either strings or lists. |
default | Undocumented |
Returns | |
Contents of config file as a string |