OpenQuizz
Une application de gestion des contenus pédagogiques
Configuration Class Reference

Public Member Functions

def __init__ (self, isolated, load_only=None)
 
def load (self)
 
def get_file_to_edit (self)
 
def items (self)
 
def get_value (self, key)
 
def set_value (self, key, value)
 
def unset_value (self, key)
 
def save (self)
 
def get_environ_vars (self)
 
def iter_config_files (self)
 
def get_values_in_config (self, variant)
 
def __repr__ (self)
 

Data Fields

 isolated
 
 load_only
 

Detailed Description

Handles management of configuration.

Provides an interface to accessing and managing configuration files.

This class converts provides an API that takes "section.key-name" style
keys and stores the value associated with it as "key-name" under the
section "section".

This allows for a clean interface wherein the both the section and the
key-name are preserved in an easy to manage form in the configuration files
and the data stored is also nice.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  isolated,
  load_only = None 
)

Member Function Documentation

◆ __repr__()

def __repr__ (   self)

◆ get_environ_vars()

def get_environ_vars (   self)
Returns a generator with all environmental vars with prefix PIP_

◆ get_file_to_edit()

def get_file_to_edit (   self)
Returns the file with highest priority in configuration

◆ get_value()

def get_value (   self,
  key 
)
Get a value from the configuration.

◆ get_values_in_config()

def get_values_in_config (   self,
  variant 
)
Get values present in a config file

◆ items()

def items (   self)
Returns key-value pairs like dict.items() representing the loaded
configuration

◆ iter_config_files()

def iter_config_files (   self)
Yields variant and configuration files associated with it.

This should be treated like items of a dictionary.

◆ load()

def load (   self)
Loads configuration from configuration files and environment

◆ save()

def save (   self)
Save the current in-memory state.

◆ set_value()

def set_value (   self,
  key,
  value 
)
Modify a value in the configuration.

◆ unset_value()

def unset_value (   self,
  key 
)
Unset a value in the configuration.

Field Documentation

◆ isolated

isolated

◆ load_only

load_only

The documentation for this class was generated from the following file: