Libosinfo.Media

g GObject.Object GObject.Object Libosinfo.Entity Libosinfo.Entity GObject.Object->Libosinfo.Entity Libosinfo.Media Libosinfo.Media Libosinfo.Entity->Libosinfo.Media

Subclasses:

None

Methods

Inherited:

Libosinfo.Entity (15), GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

create_from_location (location, cancellable)

class

create_from_location_async (location, priority, cancellable, callback, *user_data)

class

create_from_location_finish (res)

class

create_from_location_with_flags (location, cancellable, flags)

class

create_from_location_with_flags_async (location, priority, cancellable, callback, flags, *user_data)

class

create_from_location_with_flags_finish (res)

class

new (id, architecture)

add_install_script (script)

get_application_id ()

get_architecture ()

get_eject_after_install ()

get_initrd_path ()

get_install_script_list ()

get_installer ()

get_installer_reboots ()

get_kernel_path ()

get_languages ()

get_live ()

get_os ()

get_os_variants ()

get_publisher_id ()

get_system_id ()

get_url ()

get_volume_id ()

get_volume_size ()

is_bootable ()

matches (reference)

supports_installer_script ()

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Inherited:

Libosinfo.Entity (1)

Name

Type

Flags

Short Description

application-id

str

r/w

The expected ISO9660 application ID

architecture

str

r/w

CPU Architecture

eject-after-install

bool

r/w

Whether the media should be ejected after the installation process

initrd-path

str

r/w

The path to the initrd image

installer

bool

r/w

Media provides an installer

installer-reboots

int

r/w

Number of installer reboots

installer-script

bool

r/w

Whether the media should be used for an installation using install scripts

kernel-path

str

r/w

The path to the kernel image

languages

int

r

Supported languages

live

bool

r/w

Media can boot directly w/o installation

os

Libosinfo.Os

r/w

Information about the operating system on this media

publisher-id

str

r/w

The expected ISO9660 publisher ID

system-id

str

r/w

The expected ISO9660 system ID

url

str

r/w

The URL to this media

volume-id

str

r/w

The expected ISO9660 volume ID

volume-size

int

r/w

Expected ISO9660 volume size, in bytes

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

Libosinfo.Entity

r

Class Details

class Libosinfo.Media(**kwargs)
Bases:

Libosinfo.Entity

Abstract:

No

Structure:

Libosinfo.MediaClass

classmethod create_from_location(location, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

a new Libosinfo.Media , or None on error

Return type:

Libosinfo.Media

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:

Asynchronous variant of Libosinfo.Media.create_from_location.

classmethod create_from_location_finish(res)
Parameters:

res (Gio.AsyncResult) – a Gio.AsyncResult

Raises:

GLib.Error

Returns:

a new Libosinfo.Media , or None on error

Return type:

Libosinfo.Media

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

GLib.Error

Returns:

a new Libosinfo.Media , or None on error

Return type:

Libosinfo.Media

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:

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) – a Gio.AsyncResult

Raises:

GLib.Error

Returns:

a new Libosinfo.Media , or None on error

Return type:

Libosinfo.Media

Finishes an asynchronous media object creation process started with Libosinfo.Media.create_from_location_async.

classmethod new(id, architecture)
Parameters:
  • id (str) –

  • architecture (str) –

Return type:

Libosinfo.Media

add_install_script(script)
Parameters:

script (Libosinfo.InstallScript) – an Libosinfo.InstallScript instance

Adds an script to the specified self

New in version 1.4.0.

get_application_id()
Returns:

the application id, or None

Return type:

str

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

the hardware architecture, or None

Return type:

str

Retrieves the target hardware architecture of the OS self provides.

get_eject_after_install()
Returns:

True if media should be ejected, False otherwise

Return type:

bool

Whether self should ejected after the installation procces.

New in version 0.2.13.

get_initrd_path()
Returns:

the path to initrd image, or None

Return type:

str

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:

Libosinfo.InstallScriptList

New in version 1.4.0.

get_installer()
Returns:

True if media is installer, False otherwise

Return type:

bool

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:

int

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

the path to kernel image, or None

Return type:

str

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(or Libosinfo.Media ::installer) to know if the media is an installer or not.

New in version 0.2.3.

get_live()
Returns:

True if media is live, False otherwise

Return type:

bool

Whether self can boot directly an OS without any installations.

New in version 0.0.3.

get_os()
Returns:

the operating system, or None

Return type:

Libosinfo.Os

New in version 0.2.3.

get_os_variants()
Returns:

the operating system variant, or None

Return type:

Libosinfo.OsVariantList

Gets the variants of the associated operating system.

New in version 0.2.9.

get_publisher_id()
Returns:

the publisher id, or None

Return type:

str

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

the system id, or None

Return type:

str

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

the URL, or None

Return type:

str

The URL to the self

get_volume_id()
Returns:

the volume id, or None

Return type:

str

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:

int

is_bootable()
Returns:

True if the self is bootable. False otherwise.

Return type:

bool

New in version 1.6.0.

matches(reference)
Parameters:

reference (Libosinfo.Media) – a reference Libosinfo.Media instance

Returns:

True if self is a match for reference. False otherwise

Return type:

bool

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.

supports_installer_script()
Returns:

True if install-scripts are supported by the media, False otherwise

Return type:

bool

Whether self supports installation using install scripts.

New in version 1.3.0.

Property Details

Libosinfo.Media.props.application_id
Name:

application-id

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

Expected application ID (regular expression) for ISO9660 image/device.

Libosinfo.Media.props.architecture
Name:

architecture

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

The target hardware architecture of this media.

Libosinfo.Media.props.eject_after_install
Name:

eject-after-install

Type:

bool

Default Value:

True

Flags:

READABLE, WRITABLE

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

initrd-path

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

The path to the initrd image in the install tree.

Libosinfo.Media.props.installer
Name:

installer

Type:

bool

Default Value:

True

Flags:

READABLE, WRITABLE

Whether media provides an installer for an OS.

Libosinfo.Media.props.installer_reboots
Name:

installer-reboots

Type:

int

Default Value:

1

Flags:

READABLE, WRITABLE

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(or Libosinfo.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
Name:

installer-script

Type:

bool

Default Value:

True

Flags:

READABLE, WRITABLE

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

kernel-path

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

The path to the kernel image in the install tree.

Libosinfo.Media.props.languages
Name:

languages

Type:

int

Default Value:

None

Flags:

READABLE

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(or Libosinfo.Media ::installer) to know if the media is an installer or not.

Libosinfo.Media.props.live
Name:

live

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE

Whether media can boot directly an OS without any installations.

Libosinfo.Media.props.os
Name:

os

Type:

Libosinfo.Os

Default Value:

None

Flags:

READABLE, WRITABLE

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 to Libosinfo.Db.identify_media().

Libosinfo.Media.props.publisher_id
Name:

publisher-id

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

Expected publisher ID (regular expression) for ISO9660 image/device.

Libosinfo.Media.props.system_id
Name:

system-id

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

Expected system ID (regular expression) for ISO9660 image/device.

Libosinfo.Media.props.url
Name:

url

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

The URL to this media.

Libosinfo.Media.props.volume_id
Name:

volume-id

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

Expected volume ID (regular expression) for ISO9660 image/device.

Libosinfo.Media.props.volume_size
Name:

volume-size

Type:

int

Default Value:

-1

Flags:

READABLE, WRITABLE

Expected volume size, in bytes for ISO9660 image/device.