Libosinfo.Filter

g GObject.Object GObject.Object Libosinfo.Filter Libosinfo.Filter GObject.Object->Libosinfo.Filter

Subclasses:

Libosinfo.DeviceLinkFilter, Libosinfo.ProductFilter

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new ()

add_constraint (propName, propVal)

clear_constraint (propName)

clear_constraints ()

get_constraint_keys ()

get_constraint_values (propName)

matches (entity)

Virtual Methods

Inherited:

GObject.Object (7)

do_matches (entity)

Properties

None

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

GObject.Object

r

Class Details

class Libosinfo.Filter(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Libosinfo.FilterClass

classmethod new()
Returns:

a filter object

Return type:

Libosinfo.Filter

Construct a new filter that matches all entities

add_constraint(propName, propVal)
Parameters:
  • propName (str) – the name of the parameter key

  • propVal (str) – the required property value

Adds a constraint that requires the entity to have a property key propName with a value of propVal. If multiple constraints are added for the same propName, with different values, the entity have all property values.

clear_constraint(propName)
Parameters:

propName (str) – name of the key to remove constraints for

Remove all filter constraints for the matching property name.

clear_constraints()

Remove all filter property constraints

get_constraint_keys()
Returns:

List of constraint keys

Return type:

[str]

Get a list of all constraint property keys

get_constraint_values(propName)
Parameters:

propName (str) – the name of the key

Returns:

List of constraint values

Return type:

[str]

Get a list values for filter constraints with the named key

matches(entity)
Parameters:

entity (Libosinfo.Entity) – an entity to query

Returns:

True if entity passes the filter, False otherwise

Return type:

bool

Determine of an entity matches a filter

do_matches(entity) virtual
Parameters:

entity (Libosinfo.Entity) – an entity to query

Returns:

True if entity passes the filter, False otherwise

Return type:

bool

Determine of an entity matches a filter