poppy.core.configuration module

class poppy.core.configuration.Configuration(filename=None, schema=None, name=None, *args, **kwargs)[source]

Bases: poppy.core.generic.dot_dict.DotDict

Class to manage parameters from the configuration file easily, retrieve them and setting them again.

extends()[source]

Check if the file extends another one, read it and make the merge between the source file and this one.

manager = <poppy.core.generic.manager.Manager object>
classmethod merge(destination, source)[source]

Recursively merge b dictionary into a dictionary.

read()[source]

Read the configuration file in the json format and set the parameters inside the instance itself.

read_validate()[source]

Read the configuration file in JSON format and validate with the schema provided.

write()[source]

Overwrite the content of the configuration file by the parameters actually set, and make a copy of the old file before doing it in order to preserve some errors when a problem occurred in the application. A clean copy of the configuration file should also always be available in SVN repository of the program.

exception poppy.core.configuration.ConfigurationNotFound[source]

Bases: Exception

Exception for the case a configuration file is not found.