GUdev.Enumerator

g GObject.Object GObject.Object GUdev.Enumerator GUdev.Enumerator GObject.Object->GUdev.Enumerator

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new (client)

add_match_is_initialized ()

add_match_name (name)

add_match_property (name, value)

add_match_subsystem (subsystem)

add_match_sysfs_attr (name, value)

add_match_tag (tag)

add_nomatch_subsystem (subsystem)

add_nomatch_sysfs_attr (name, value)

add_sysfs_path (sysfs_path)

execute ()

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Name

Type

Flags

Short Description

client

GUdev.Client

r/w/co

The client to enumerate devices from

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent

GObject.Object

r

Class Details

class GUdev.Enumerator(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

GUdev.EnumeratorClass

GUdev.Enumerator is used to lookup and sort devices.

New in version 165.

classmethod new(client)
Parameters:

client (GUdev.Client) – A GUdev.Client to enumerate devices from.

Returns:

A new GUdev.Enumerator object. Free with GObject.Object.unref().

Return type:

GUdev.Enumerator

Constructs a GUdev.Enumerator object that can be used to enumerate and sort devices. Use the add_match_*() and add_nomatch_*() methods and execute the query to get a list of devices with GUdev.Enumerator.execute().

New in version 165.

add_match_is_initialized()
Returns:

The passed in self.

Return type:

GUdev.Enumerator

All returned devices will be initialized.

New in version 165.

add_match_name(name)
Parameters:

name (str) – Wildcard filter for kernel name e.g. “sda*”.

Returns:

The passed in self.

Return type:

GUdev.Enumerator

All returned devices will match the given name.

New in version 165.

add_match_property(name, value)
Parameters:
  • name (str) – Wildcard filter for property name.

  • value (str) – Wildcard filter for property value.

Returns:

The passed in self.

Return type:

GUdev.Enumerator

All returned devices will have a property matching the given name and value.

New in version 165.

add_match_subsystem(subsystem)
Parameters:

subsystem (str) – Wildcard for subsystem name e.g. ‘scsi’ or ‘a*’.

Returns:

The passed in self.

Return type:

GUdev.Enumerator

All returned devices will match the given subsystem.

New in version 165.

add_match_sysfs_attr(name, value)
Parameters:
  • name (str) – Wildcard filter for sysfs attribute key.

  • value (str) – Wildcard filter for sysfs attribute value.

Returns:

The passed in self.

Return type:

GUdev.Enumerator

All returned devices will have a sysfs attribute matching the given name and value.

New in version 165.

add_match_tag(tag)
Parameters:

tag (str) – A udev tag e.g. “udev-acl”.

Returns:

The passed in self.

Return type:

GUdev.Enumerator

All returned devices will match the given tag.

New in version 165.

add_nomatch_subsystem(subsystem)
Parameters:

subsystem (str) – Wildcard for subsystem name e.g. ‘scsi’ or ‘a*’.

Returns:

The passed in self.

Return type:

GUdev.Enumerator

All returned devices will not match the given subsystem.

New in version 165.

add_nomatch_sysfs_attr(name, value)
Parameters:
  • name (str) – Wildcard filter for sysfs attribute key.

  • value (str) – Wildcard filter for sysfs attribute value.

Returns:

The passed in self.

Return type:

GUdev.Enumerator

All returned devices will not have a sysfs attribute matching the given name and value.

New in version 165.

add_sysfs_path(sysfs_path)
Parameters:

sysfs_path (str) – A sysfs path, e.g. “/sys/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda”

Returns:

The passed in self.

Return type:

GUdev.Enumerator

Add a device to the list of devices, to retrieve it back sorted in dependency order.

New in version 165.

execute()
Returns:

A list of GUdev.Device objects. The caller should free the result by using GObject.Object.unref() on each element in the list and then g_list_free() on the list.

Return type:

[GUdev.Device]

Executes the query in self.

New in version 165.

Property Details

GUdev.Enumerator.props.client
Name:

client

Type:

GUdev.Client

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The GUdev.Client to enumerate devices from.

New in version 165.