Wp.Conf¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/co |
The name of the configuration file |
||
r/w/co |
Signals¶
- Inherited:
Fields¶
- Inherited:
Class Details¶
- class Wp.Conf(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
Wp.Conf
allows accessing the different sections of the wireplumber configuration.- classmethod new(name, properties)¶
- Parameters:
name (
str
) – the name of the configuration fileproperties (
Wp.Properties
orNone
) – aWp.Properties
with keys specifying how to load theWp.Conf
object
- Returns:
a new
Wp.Conf
object- Return type:
Creates a new
Wp.Conf
object.This does not open the files, it only creates the object. For most use cases, you should use
Wp.Conf.new_open
() instead.
- classmethod new_open(name, properties)¶
- Parameters:
name (
str
) – the name of the configuration fileproperties (
Wp.Properties
orNone
) – aWp.Properties
with keys specifying how to load theWp.Conf
object
- Raises:
- Returns:
- Return type:
Creates a new
Wp.Conf
object and opens the configuration file and its fragments, keeping them mapped in memory for further access.
- close()¶
Closes the configuration file and its fragments.
- get_name()¶
- Returns:
the name of the configuration file
- Return type:
Gets the name of the configuration file.
- get_section(section)¶
- Parameters:
section (
str
) – the section name- Returns:
the JSON value of the section or
None
if the section does not exist- Return type:
Wp.SpaJson
orNone
This method will get the JSON value of a specific section from the configuration. If the same section is defined in multiple locations, the sections with the same name will be either merged in case of arrays and objects, or overridden in case of boolean, int, double and strings.
- is_open()¶
-
Tests if the configuration files are open.
- open()¶
- Raises:
- Returns:
- Return type:
Opens the configuration file and its fragments and keeps them mapped in memory for further access.
- parse_pw_context_sections(context)¶
-
Parses standard pw_context sections from conf.
- section_update_props(section, props)¶
- Parameters:
section (
str
) – the section nameprops (
Wp.Properties
) – the properties to update
- Returns:
the number of properties updated
- Return type:
Updates the given properties with the values of a specific section from the configuration.
Property Details¶
- Wp.Conf.props.name¶
- Name:
name
- Type:
- Default Value:
- Flags:
The name of the configuration file
- Wp.Conf.props.properties¶
- Name:
properties
- Type:
- Default Value:
- Flags: