Libosinfo.Entity¶
- Subclasses:
Libosinfo.AvatarFormat
,Libosinfo.Datamap
,Libosinfo.Deployment
,Libosinfo.Device
,Libosinfo.DeviceDriver
,Libosinfo.DeviceLink
,Libosinfo.Firmware
,Libosinfo.Image
,Libosinfo.InstallConfig
,Libosinfo.InstallConfigParam
,Libosinfo.InstallScript
,Libosinfo.Media
,Libosinfo.OsVariant
,Libosinfo.Product
,Libosinfo.Resources
,Libosinfo.Tree
Methods¶
- Inherited:
- Structs:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/c |
Unique identifier |
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent_instance |
r |
Class Details¶
- class Libosinfo.Entity(**kwargs)¶
- Bases:
- Abstract:
Yes
- Structure:
- add_param(key, value)¶
-
Adds a new parameter against the entity. A key can have multiple values associated. Thus repeated calls with the same key will build up a list of possible values.
- clear_param(key)¶
- Parameters:
key (
str
) – the name of the key
Remove all values associated with a key
- get_id()¶
- Returns:
the unique key for the entity
- Return type:
Retrieves the unique key for the entity. The format of identifiers is undefined, but the recommended practice is to use a URI.
- get_param_keys()¶
- Returns:
The list of string parameters
- Return type:
[
str
]
Retrieve all the known parameter keys associated with the entity
- get_param_value(key)¶
- Parameters:
key (
str
) – the name of the key- Returns:
the value associated with the key, or
None
- Return type:
Retrieve the parameter value associated with a named key. If multiple values are stored against the key, only the first value is returned. If no value is associated,
None
is returned
- get_param_value_boolean(key)¶
- Parameters:
key (
str
) – the name of the key- Returns:
the value associated with the key as a boolean, or
False
- Return type:
Retrieve the parameter value associated with a named key as a boolean. If multiple values are stored against the key, only the first value is returned. If no value is associated,
False
is returnedNew in version 0.2.0.
- get_param_value_boolean_with_default(key, default_value)¶
- Parameters:
- Returns:
the value associated with the key as a boolean, or default_value
- Return type:
Retrieve the parameter value associated with a named key as a boolean. If multiple values are stored against the key, only the first value is returned. If no value is associated, default_value is returned.
New in version 0.2.1.
- get_param_value_enum(key, enum_type, default_value)¶
- Parameters:
key (
str
) – the name of the keyenum_type (
GObject.GType
) – the enum typedefault_value (
int
) – the default value to be used, in case there’s no value associated with the key
- Returns:
the enum value associated with the key, or default_value.
- Return type:
Retrieve the parameter value associated with a named key as an enum value. If multiple values are stored against the key, only the first value is returned. If no value is associated, the default_value is returned.
New in version 0.2.2.
- get_param_value_int64(key)¶
- Parameters:
key (
str
) – the name of the key- Returns:
the value associated with the key as an int64, or -1.
- Return type:
Retrieve the parameter value associated with a named key as an int64. If multiple values are stored against the key, only the first value is returned. If no value is associated, -1 is returned.
New in version 0.2.1.
- get_param_value_int64_with_default(key, default_value)¶
- Parameters:
- Returns:
the value associated with the key as an int64, or default_value
- Return type:
Retrieve the parameter value associated with a named key as an int64. If multiple values are stored against the key, only the first value is returned. If no value is associated, default_value is returned.
New in version 0.2.1.
- get_param_value_list(key)¶
- Parameters:
key (
str
) – the name of the key- Returns:
the values associated with the key
- Return type:
[
str
]
Retrieve all the parameter values associated with a named key. If no values are associated,
None
is returned
- set_param(key, value)¶
-
Sets a new parameter against the entity. If the key already has a value associated with it, the existing value will be cleared.
- set_param_boolean(key, value)¶
- Parameters:
Sets a new parameter against the entity. If the key already has a value associated with it, the existing value will be cleared.
New in version 0.2.0.
- set_param_enum(key, value, enum_type)¶
- Parameters:
key (
str
) – the name of the keyvalue (
int
) – the enum value to be associated with that keyenum_type (
GObject.GType
) – the enum type
Sets a new parameter against the entity. If the key already has a value associated with it, the existing value will be cleared.
New in version 0.2.2.
Property Details¶
- Libosinfo.Entity.props.id¶
-
The unique identifier for the entity The format of identifiers is undefined, but the recommended practice is to use a URI. This parameter must be set at time of construction as no default value is provided.