abc-classroom.config

abcclassroom.config.get_config(configpath=None)[source]
abcclassroom.config.get_config_option(config, option, required=True)[source]

Get an option (value of key) from provided config dictionary. If the key does not exist, exit with KeyError (required=True) or return None (required=False).

abcclassroom.config.get_github_auth()[source]

Check to see if there is an existing github authentication and load the authentication.

Returns

Yaml object that contains the token and id for a github session. If yaml doesn’t exists, return an empty dictionary.

Return type

ruamel.yaml.comments.CommentedMap

abcclassroom.config.print_config(config=None, configpath=None)[source]

Print configuration. Can supply as dictionary parameter, or specify a path to look for config.yml. If neither option specified, looks for config.yml in current working directory. If both specified, prints dictionary, not from file.

abcclassroom.config.set_config_option(config, option, value, append_value=False, configpath=None)[source]

Sets a config option. If option already exists and append_value is False, replaces existing value. If option exists and append_value is true, adds new value to list of existing values. Will not add a duplicate value.

Writes the new config (overwriting the existing file) and returns new config dict.

abcclassroom.config.set_github_auth(auth_info)[source]

Set the github authentication information. Put the token and id authentication information into a yaml file if it doesn’t already exist.

Parameters

auth_info (dictionary) – The token and id authentication information from github stored in a dictionary object.

abcclassroom.config.write_config(config, configpath=None)[source]