Wp.Conf

g GObject.Object GObject.Object Wp.Conf Wp.Conf GObject.Object->Wp.Conf

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new (name, properties)

class

new_open (name, properties)

close ()

get_name ()

get_section (section)

is_open ()

open ()

parse_pw_context_sections (context)

section_update_props (section, props)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Name

Type

Flags

Short Description

name

str

r/w/co

The name of the configuration file

properties

Wp.Properties

r/w/co

Wp.Properties

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Class Details

class Wp.Conf(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Wp.ConfClass

Wp.Conf allows accessing the different sections of the wireplumber configuration.

classmethod new(name, properties)
Parameters:
Returns:

a new Wp.Conf object

Return type:

Wp.Conf

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:
Raises:

GLib.Error

Returns:

a new Wp.Conf object, or None if an error occurred

Return type:

Wp.Conf or None

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:

str

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 or None

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()
Returns:

True if the configuration files are open, False otherwise

Return type:

bool

Tests if the configuration files are open.

open()
Raises:

GLib.Error

Returns:

True on success, False on error

Return type:

bool

Opens the configuration file and its fragments and keeps them mapped in memory for further access.

parse_pw_context_sections(context)
Parameters:

context (object or None) – the associated pw_context

Parses standard pw_context sections from conf.

section_update_props(section, props)
Parameters:
  • section (str) – the section name

  • props (Wp.Properties) – the properties to update

Returns:

the number of properties updated

Return type:

int

Updates the given properties with the values of a specific section from the configuration.

Property Details

Wp.Conf.props.name
Name:

name

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The name of the configuration file

Wp.Conf.props.properties
Name:

properties

Type:

Wp.Properties

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

Wp.Properties