Libosinfo.Tree

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

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_treeinfo (treeinfo, location)

class

new (id, architecture)

get_architecture ()

get_boot_iso_path ()

get_initrd_path ()

get_kernel_path ()

get_os ()

get_os_variants ()

get_treeinfo_arch ()

get_treeinfo_family ()

get_treeinfo_variant ()

get_treeinfo_version ()

get_url ()

has_treeinfo ()

matches (reference)

set_os (os)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Inherited:

Libosinfo.Entity (1)

Name

Type

Flags

Short Description

architecture

str

r/w

CPU Architecture

boot-iso-path

str

r/w

The path to the bootable ISO image

has-treeinfo

bool

r/w

Whether the tree has treeinfo

initrd-path

str

r/w

The path to the initrd image

kernel-path

str

r/w

The path to the kernel image

os

Libosinfo.Os

r/w

Information about the operating system on this tree

treeinfo-arch

str

r/w

The treeinfo architecture

treeinfo-family

str

r/w

The treeinfo family

treeinfo-variant

str

r/w

The treeinfo variant

treeinfo-version

str

r/w

The treeinfo version

url

str

r/w

The URL to this tree

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

Libosinfo.Entity

r

Class Details

class Libosinfo.Tree(**kwargs)
Bases:

Libosinfo.Entity

Abstract:

No

Structure:

Libosinfo.TreeClass

classmethod create_from_location(location, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

a new Libosinfo.Tree , or None on error

Return type:

Libosinfo.Tree

Creates a new Libosinfo.Tree for installation tree at location. The location could be a http:// or a https:// URI, or a local file.

NOTE: Currently this only works for trees with a .treeinfo file

New in version 0.1.0.

classmethod create_from_location_async(location, priority, cancellable, callback, *user_data)
Parameters:

Asynchronous variant of Libosinfo.Tree.create_from_location.

New in version 0.1.0.

classmethod create_from_location_finish(res)
Parameters:

res (Gio.AsyncResult) – a Gio.AsyncResult

Raises:

GLib.Error

Returns:

a new Libosinfo.Tree , or None on error

Return type:

Libosinfo.Tree

Finishes an asynchronous tree object creation process started with Libosinfo.Tree.create_from_location_async.

New in version 0.1.0.

classmethod create_from_treeinfo(treeinfo, location)
Parameters:
  • treeinfo (str) – a string representing the .treeinfo content

  • location (str) – the location of the original treeinfo

Raises:

GLib.Error

Returns:

a new Libosinfo.Tree, or None on error

Return type:

Libosinfo.Tree

Creates a new Libosinfo.Tree for installation tree represented by treeinfo.

New in version 1.7.0.

classmethod new(id, architecture)
Parameters:
  • id (str) – the id of the tree to be created

  • architecture (str) – the architecture of the tree to be created

Returns:

A tree entity

Return type:

Libosinfo.Tree

Create a new tree entity

New in version 0.1.0.

get_architecture()
Returns:

the hardware architecture, or None

Return type:

str

Retrieves the target hardware architecture of the OS self provides.

New in version 0.1.0.

get_boot_iso_path()
Returns:

the path to boot_iso image, or None

Return type:

str

Retrieves the path to the boot_iso image in the install tree.

New in version 0.1.0.

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 trees of ‘linux’ OS family.

New in version 0.1.0.

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 trees of ‘linux’ OS family.

New in version 0.1.0.

get_os()
Returns:

the operating system, or None

Return type:

Libosinfo.Os

New in version 1.5.0.

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 1.5.0.

get_treeinfo_arch()
Returns:

the treeinfo architecture, or None

Return type:

str

If self has treeinfo, this function retrieves the expected architecture.

Note: In practice, this will usually not be the exact copy of the architecture but rather a regular expression that matches it.

New in version 0.1.0.

get_treeinfo_family()
Returns:

the treeinfo family, or None

Return type:

str

If self has treeinfo, this function retrieves the expected family.

Note: In practice, this will usually not be the exact copy of the family but rather a regular expression that matches it.

New in version 0.1.0.

get_treeinfo_variant()
Returns:

the treeinfo variant, or None

Return type:

str

If self has treeinfo, this function retrieves the expected variant.

Note: In practice, this will usually not be the exact copy of the variant but rather a regular expression that matches it.

New in version 0.1.0.

get_treeinfo_version()
Returns:

the treeinfo version, or None

Return type:

str

If self has treeinfo, this function retrieves the expected version.

Note: In practice, this will usually not be the exact copy of version but rather a regular expression that matches it.

New in version 0.1.0.

get_url()
Returns:

the URL, or None

Return type:

str

The URL to the self

New in version 0.1.0.

has_treeinfo()
Returns:

True if the tree has treeinfo. False otherwise.

Return type:

bool

Return whether a tree has treeinfo or not.

New in version 1.3.0.

matches(reference)
Parameters:

reference (Libosinfo.Tree) – a reference Libosinfo.Tree 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 tree.

The metadata in the unidentified self must be literal strings, while the metadata in the reference tree must be regular expressions.

New in version 1.10.0.

set_os(os)
Parameters:

os (Libosinfo.Os) – an Libosinfo.Os instance

Sets the Libosinfo.Os associated to the Libosinfo.Tree instance.

New in version 1.5.0.

Property Details

Libosinfo.Tree.props.architecture
Name:

architecture

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

The target hardware architecture of this tree.

Libosinfo.Tree.props.boot_iso_path
Name:

boot-iso-path

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

The path to the boot ISO in the install tree

Libosinfo.Tree.props.has_treeinfo
Name:

has-treeinfo

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE

Whether the tree has treeinfo or not

Libosinfo.Tree.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.Tree.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.Tree.props.os
Name:

os

Type:

Libosinfo.Os

Default Value:

None

Flags:

READABLE, WRITABLE

Os information for the current tree. For tree 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_tree().

Libosinfo.Tree.props.treeinfo_arch
Name:

treeinfo-arch

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

The treeinfo arch

Libosinfo.Tree.props.treeinfo_family
Name:

treeinfo-family

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

The treeinfo family

Libosinfo.Tree.props.treeinfo_variant
Name:

treeinfo-variant

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

The treeinfo variant

Libosinfo.Tree.props.treeinfo_version
Name:

treeinfo-version

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

The treeinfo version

Libosinfo.Tree.props.url
Name:

url

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

The URL to this tree.