aniping.config

config

This submodule handles reading the config yaml file. Since we use flask to handle the config file, all this submodule does is extend the existing flask modules to support the yaml format.

This is a terminal submodule for the aniping package, and so should not import any additional aniping submodules.

class aniping.config.Config(root_path, defaults=None)

Extension of the flask config class.

Adds the from_yaml function to the flask Config class. This function was found originally at https://gist.github.com/mattupstate/2046115.

from_yaml(config_file)

Yaml config getter function.

Reads a yaml flask config file and generates a config dictionary out of it that flask and aniping can both understand.

Parameters:config_file (str) – the path of the config file to load. Can be relative or absolute.
class aniping.config.Flask(import_name, static_path=None, static_url_path=None, static_folder='static', template_folder='templates', instance_path=None, instance_relative_config=False, root_path=None)

Extenstion of the flask class.

This modifies the make_config function to support the Config.from_yaml function.

make_config(instance_relative=False)

Config generation function.

Determines what the root path of the app is and returns a config instance with that in mind.

Parameters:instance_relative (bool) – If this is a relative instance.
Returns:A config object with the determined root path.