pcvs.backend.configfile module
Module for parsing configuration.
ConfigFile: a file on the disc, can be read, write, verify, edited, display …YmlConfigFile: inheriteConfigFileand add yaml parsing support.Profile: AYmlConfigFilethat also contain multiples othersYmlConfigFilethat represent it’s configuration.
From a user persperctive, a ConfigFile is a file, gathered in a Python
object information relative to the configuration of a single component.
In PCVS, there is 7 types of components:
5 basic blocks:
Compiler (defining compiler commands)
Runtime (setting runtime & parametrization)
Machine (Defining resources used for execution)
Group (used a templates to globally describe tests)
Criterion (range of parameters used to run a test-suite)
2 special:
Profile (a group of one of each the above configuration)
Plugin (a python plugin)
These classes helps to manage any of these config blocks above.
- class pcvs.backend.configfile.ConfigFile(config_desc)[source]
Bases:
objectHandle configuration file.
- Variables:
_raw (
str) – the content of the file_descriptor (
ConfigDesc) – the of the current file.
Initialize a configuration file representation.
- property descriptor: ConfigDesc
Return the description of the config file.
- edit()[source]
Open the current configuration for edition.
After eddition, the new file is loaded, check and then written to disk.
- Return type:
None
- property exist: bool
Return if the config file exist on disk.
- flush_to_disk()[source]
Write the configuration to disk.
Also check the configuration before writing it do disk.
- Return type:
None
- property full_name: str
Return full name.
- load_from_disk()[source]
Load the configuration file to populate the current object.
Also verify the loaded content according to schema (for yml files).
- Return type:
None
- property loaded: bool
Return if the config is loaded in Object.
- class pcvs.backend.configfile.Profile(config_desc, cl=None)[source]
Bases:
YmlConfigFileA profile represents the most complete object the user can provide.
It is built upon 5 configuration, one of each kind (compiler, runtime, machine, criterion & group) and plugins and gathers all required information to start a validation process. A profile object is the basic representation to be manipulated by the user.
- Variables:
_config_locator (
ConfigLocator) – the ConfigLocator use to locate the configurations referenced in the profile._innerconfigs (
dict[str, YmlConfigFile]) – the Configuration referenced by the profile once loaded.
Initialize a profile.
- Parameters:
config_desc (
ConfigDesc) – The config Descriptor for the profile file.cl (
ConfigLocator|None) – A ConfigLocator Object used to locat config specify by Profile.
- CONFIGS_KINDS = [COMPILER, CRITERION, GROUP, MACHINE, RUNTIME]
- class pcvs.backend.configfile.YmlConfigFile(config_desc)[source]
Bases:
ConfigFileA Yaml File Configuration.
- Variables:
_details (
dict) – the yaml representation of the configuration.
Initialize a Yaml configuration file representation.
- property config: Config
Get config object associated with config file.
- Returns:
the config object associated with the config file.
- pcvs.backend.configfile.get_conf(cd)[source]
Get Appropriate ConfigFile Object from a
ConfigDesc.- Return type: