Libosinfo.Media¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
- Inherited:
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w |
The expected ISO9660 application ID |
||
r/w |
CPU Architecture |
||
r/w |
Whether the media should be ejected after the installation process |
||
r/w |
The path to the initrd image |
||
r/w |
Media provides an installer |
||
r/w |
Number of installer reboots |
||
r/w |
Whether the media should be used for an installation using install scripts |
||
r/w |
The path to the kernel image |
||
r |
Supported languages |
||
r/w |
Media can boot directly w/o installation |
||
r/w |
Information about the operating system on this media |
||
r/w |
The expected ISO9660 publisher ID |
||
r/w |
The expected ISO9660 system ID |
||
r/w |
The URL to this media |
||
r/w |
The expected ISO9660 volume ID |
||
r/w |
Expected ISO9660 volume size, in bytes |
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent_instance |
r |
Class Details¶
- class Libosinfo.Media(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod create_from_location(location, cancellable)¶
- Parameters:
location (
str
) – the location of an installation mediacancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
- Raises:
- Returns:
a new
Libosinfo.Media
, orNone
on error- Return type:
Creates a new
Libosinfo.Media
for installation media at location. The location could be a http:// or a https:// URI or a local path.NOTE: Currently this only works for ISO images/devices.
- classmethod create_from_location_async(location, priority, cancellable, callback, *user_data)¶
- Parameters:
location (
str
) – the location of an installation mediapriority (
int
) – the I/O priority of the requestcancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
callback (
Gio.AsyncReadyCallback
orNone
) – Function to call when result of this call is readyuser_data (
object
orNone
) – The user data to pass to callback, orNone
Asynchronous variant of
Libosinfo.Media.create_from_location
.
- classmethod create_from_location_finish(res)¶
- Parameters:
res (
Gio.AsyncResult
) – aGio.AsyncResult
- Raises:
- Returns:
a new
Libosinfo.Media
, orNone
on error- Return type:
Finishes an asynchronous media object creation process started with
Libosinfo.Media.create_from_location_async
.New in version 1.6.0.
- classmethod create_from_location_with_flags(location, cancellable, flags)¶
- Parameters:
location (
str
) – the location of an installation mediacancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
flags (
int
) – AnLibosinfo.MediaDetectFlag
, or 0.
- Raises:
- Returns:
a new
Libosinfo.Media
, orNone
on error- Return type:
Creates a new
Libosinfo.Media
for installation media at location. The location could be a http:// or a https:// URI or a local path.NOTE: Currently this only works for ISO images/devices.
New in version 1.6.0.
- classmethod create_from_location_with_flags_async(location, priority, cancellable, callback, flags, *user_data)¶
- Parameters:
location (
str
) – the location of an installation mediapriority (
int
) – the I/O priority of the requestcancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
callback (
Gio.AsyncReadyCallback
orNone
) – Function to call when result of this call is readyflags (
int
) – AnLibosinfo.MediaDetectFlag
, or 0.user_data (
object
orNone
) – The user data to pass to callback, orNone
Asynchronous variant of
Libosinfo.Media.create_from_location_with_flags
.New in version 1.6.0.
- classmethod create_from_location_with_flags_finish(res)¶
- Parameters:
res (
Gio.AsyncResult
) – aGio.AsyncResult
- Raises:
- Returns:
a new
Libosinfo.Media
, orNone
on error- Return type:
Finishes an asynchronous media object creation process started with
Libosinfo.Media.create_from_location_async
.
- classmethod new(id, architecture)¶
- Parameters:
- Return type:
- add_install_script(script)¶
- Parameters:
script (
Libosinfo.InstallScript
) – anLibosinfo.InstallScript
instance
Adds an script to the specified self
New in version 1.4.0.
- get_application_id()¶
-
If self is an ISO9660 image/device, this function retrieves the expected application ID.
Note: In practice, this will usually not be the exact copy of the application ID string on the ISO image/device but rather a regular expression that matches it.
- get_architecture()¶
-
Retrieves the target hardware architecture of the OS self provides.
- get_eject_after_install()¶
-
Whether self should ejected after the installation procces.
New in version 0.2.13.
- get_initrd_path()¶
-
Retrieves the path to the initrd image in the install tree.
Note: This only applies to installer medias of ‘linux’ OS family.
- get_install_script_list()¶
- Returns:
a list of the install scripts for the specified media
- Return type:
New in version 1.4.0.
- get_installer()¶
-
Whether self provides an installer for an OS.
New in version 0.0.3.
- get_installer_reboots()¶
- Returns:
the number of installer reboots or -1 if media is not an installer
- Return type:
If media is an installer, this method retrieves the number of reboots the installer takes before installation is complete.
This function is not supposed to be called on media that has no installer. You can use
Libosinfo.Media.get_installer
(orLibosinfo.Media
::installer
) to check that.Warning: Some media allow you to install from live sessions, in which case number of reboots *alone* is not a reliable method for tracking installation.
New in version 0.2.1.
- get_kernel_path()¶
-
Retrieves the path to the kernel image in the install tree.
Note: This only applies to installer medias of ‘linux’ OS family.
- get_languages()¶
- Returns:
a
GLib.List
containing the list of the UI languages this media supports. The list must be freed with g_list_free() when no longer needed. If the supported languages are unknown,None
will be returned.- Return type:
[
str
]
If media is an installer, this property indicates the languages that can be used during automatic installations.
On media that are not installers, this property will indicate the languages that the user interface can be displayed in. Use
Libosinfo.Media.get_installer
(orLibosinfo.Media
::installer
) to know if the media is an installer or not.New in version 0.2.3.
- get_live()¶
-
Whether self can boot directly an OS without any installations.
New in version 0.0.3.
- get_os_variants()¶
- Returns:
the operating system variant, or
None
- Return type:
Gets the variants of the associated operating system.
New in version 0.2.9.
- get_publisher_id()¶
-
If self is an ISO9660 image/device, this function retrieves the expected publisher ID.
Note: In practice, this will usually not be the exact copy of the publisher ID string on the ISO image/device but rather a regular expression that matches it.
- get_system_id()¶
-
If self is an ISO9660 image/device, this function retrieves the expected system ID.
Note: In practice, this will usually not be the exact copy of the system ID string on the ISO image/device but rather a regular expression that matches it.
- get_volume_id()¶
-
If self is an ISO9660 image/device, this function retrieves the expected volume ID.
Note: In practice, this will usually not be the exact copy of the volume ID string on the ISO image/device but rather a regular expression that matches it.
- get_volume_size()¶
- Returns:
the ISO9660 volume size, in bytes or -1 if size is unknown or media is not an ISO9660 device/image.
- Return type:
- is_bootable()¶
-
New in version 1.6.0.
- matches(reference)¶
- Parameters:
reference (
Libosinfo.Media
) – a referenceLibosinfo.Media
instance- Returns:
- Return type:
Determines whether the metadata for the unidentified self is a match for the reference media.
The metadata in the unidentified self must be literal strings, while the metadata in the reference media must be regular expressions.
New in version 1.10.0.
Property Details¶
- Libosinfo.Media.props.application_id¶
-
Expected application ID (regular expression) for ISO9660 image/device.
- Libosinfo.Media.props.architecture¶
-
The target hardware architecture of this media.
- Libosinfo.Media.props.eject_after_install¶
-
Whether the media should be ejected after the installation process.
Some distros need their media to not be ejected after the final reboot during its installation process as some packages are installed after the reboot (which may cause the media to be ejected, depending on the application).
- Libosinfo.Media.props.initrd_path¶
-
The path to the initrd image in the install tree.
- Libosinfo.Media.props.installer¶
-
Whether media provides an installer for an OS.
- Libosinfo.Media.props.installer_reboots¶
-
If media is an installer, this property indicates the number of reboots the installer takes before installation is complete.
This property is not applicable to media that has no installer. You can use
Libosinfo.Media.get_installer
(orLibosinfo.Media
::installer
) to check that.Warning: Some media allow you to install from live sessions, in which case number of reboots *alone* is not a reliable method for tracking installation.
- Libosinfo.Media.props.installer_script¶
-
Whether the media supports installation via an install-script.
Some distros provide a few different medias and not all the medias support installation via an install script.
- Libosinfo.Media.props.kernel_path¶
-
The path to the kernel image in the install tree.
- Libosinfo.Media.props.languages¶
-
If media is an installer, this property indicates the languages that can be used during automatic installations.
On media that are not installers, this property will indicate the languages that the user interface can be displayed in. Use
Libosinfo.Media.get_installer
(orLibosinfo.Media
::installer
) to know if the media is an installer or not.
- Libosinfo.Media.props.live¶
-
Whether media can boot directly an OS without any installations.
- Libosinfo.Media.props.os¶
- Name:
os
- Type:
- Default Value:
- Flags:
Os information for the current media. For media stored in an
Libosinfo.Db
, it will be filled when the database is loaded, otherwise the property will be filled after a successful call toLibosinfo.Db.identify_media
().
- Libosinfo.Media.props.publisher_id¶
-
Expected publisher ID (regular expression) for ISO9660 image/device.
- Libosinfo.Media.props.system_id¶
-
Expected system ID (regular expression) for ISO9660 image/device.
- Libosinfo.Media.props.url¶
-
The URL to this media.
- Libosinfo.Media.props.volume_id¶
-
Expected volume ID (regular expression) for ISO9660 image/device.