Fwupd.JcatFile

g Fwupd.Codec Fwupd.Codec Fwupd.JcatFile Fwupd.JcatFile Fwupd.Codec->Fwupd.JcatFile GObject.GInterface GObject.GInterface GObject.GInterface->Fwupd.Codec GObject.Object GObject.Object GObject.Object->Fwupd.JcatFile

Subclasses:

None

Methods

Inherited:

GObject.Object (37), Fwupd.Codec (22)

Structs:

GObject.ObjectClass (5)

class

new ()

add_item (item)

export_bytes ()

export_json (flags)

get_item_by_id (id)

get_item_default ()

get_items ()

get_version_major ()

get_version_minor ()

import_bytes (blob)

import_json (json)

import_stream (istream)

Virtual Methods

Inherited:

GObject.Object (7), Fwupd.Codec (7)

Properties

None

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Class Details

class Fwupd.JcatFile(**kwargs)
Bases:

GObject.Object, Fwupd.Codec

Abstract:

No

Structure:

Fwupd.JcatFileClass

classmethod new()[source]
Returns:

a Fwupd.JcatFile

Return type:

Fwupd.JcatFile

Creates a new file.

New in version 2.1.3.

add_item(item)[source]
Parameters:

item (Fwupd.JcatItem) – Fwupd.JcatItem

Adds an item to a file.

New in version 2.1.3.

export_bytes()[source]
Raises:

GLib.Error

Returns:

a GLib.Bytes

Return type:

GLib.Bytes

Exports a FwupdJcat file to a compressed blob.

New in version 2.1.3.

export_json(flags)[source]
Parameters:

flags (Fwupd.CodecFlags) – a Fwupd.CodecFlags, typically Fwupd.CodecFlags.NONE

Raises:

GLib.Error

Returns:

JSON output, or None for error

Return type:

str

Exports a FwupdJcat file to raw JSON.

New in version 2.1.3.

get_item_by_id(id)[source]
Parameters:

id (str) – An ID, typically a filename basename

Raises:

GLib.Error

Returns:

a Fwupd.JcatItem, or None if the filename was not found

Return type:

Fwupd.JcatItem

Finds the item with the specified ID, falling back to the ID alias if set.

New in version 2.1.3.

get_item_default()[source]
Raises:

GLib.Error

Returns:

a Fwupd.JcatItem, or None if no default exists

Return type:

Fwupd.JcatItem

Finds the default item. If more than one Fwupd.JcatItem exists this function will return with an error.

New in version 2.1.3.

get_items()[source]
Returns:

all the items in the file

Return type:

[Fwupd.JcatItem]

Returns all the items in the file.

New in version 2.1.3.

get_version_major()[source]
Returns:

integer

Return type:

int

Returns the major version number of the FwupdJcat specification

New in version 2.1.3.

get_version_minor()[source]
Returns:

integer

Return type:

int

Returns the minor version number of the FwupdJcat specification

New in version 2.1.3.

import_bytes(blob)[source]
Parameters:

blob (GLib.Bytes) – a GLib.Bytes

Raises:

GLib.Error

Returns:

True for success

Return type:

bool

Imports a compressed FwupdJcat file from a blob of data.

New in version 2.1.3.

import_json(json)[source]
Parameters:

json (str) – JSON data

Raises:

GLib.Error

Returns:

True for success

Return type:

bool

Imports a FwupdJcat file from raw JSON.

New in version 2.1.3.

import_stream(istream)[source]
Parameters:

istream (Gio.InputStream) – Gio.InputStream

Raises:

GLib.Error

Returns:

True for success

Return type:

bool

Imports a compressed FwupdJcat file from a file.

New in version 2.1.3.