Jcat.Item

g GObject.Object GObject.Object Jcat.Item Jcat.Item GObject.Object->Jcat.Item

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new (id)

add_alias_id (id)

add_blob (blob)

get_alias_ids ()

get_blob_by_kind (kind)

get_blobs ()

get_blobs_by_kind (kind)

get_id ()

has_target ()

remove_alias_id (id)

to_string ()

Virtual Methods

Inherited:

GObject.Object (7)

Properties

None

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

GObject.Object

r

Class Details

class Jcat.Item(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Jcat.ItemClass

classmethod new(id)
Parameters:

id (str) – An item ID, typically a file basename

Returns:

a Jcat.Item

Return type:

Jcat.Item

Creates a new item.

New in version 0.1.0.

add_alias_id(id)
Parameters:

id (str) – An item ID alias, typically a file basename

Adds an item alias ID. Alias IDs are matched when using functions such as Jcat.File.get_item_by_id().

New in version 0.1.1.

add_blob(blob)
Parameters:

blob (Jcat.Blob) – Jcat.Blob

Adds a new blob to the item.

New in version 0.1.0.

get_alias_ids()
Returns:

array

Return type:

[str]

Gets the list of alias IDs.

New in version 0.1.1.

get_blob_by_kind(kind)
Parameters:

kind (Jcat.BlobKind) – Jcat.BlobKind, e.g. Jcat.BlobKind.SHA256

Raises:

GLib.Error

Returns:

a blob, or None

Return type:

Jcat.Blob

Gets the item blobs by a specific kind.

New in version 0.2.0.

get_blobs()
Returns:

blobs

Return type:

[Jcat.Blob]

Gets all the blobs for this item.

New in version 0.1.0.

get_blobs_by_kind(kind)
Parameters:

kind (Jcat.BlobKind) – Jcat.BlobKind, e.g. Jcat.BlobKind.SHA256

Returns:

blobs

Return type:

[Jcat.Blob]

Gets the item blobs by a specific kind.

New in version 0.1.0.

get_id()
Returns:

string

Return type:

str

Returns the item ID.

New in version 0.1.0.

has_target()
Returns:

True on success

Return type:

bool

Finds out if any of the blobs are targeting an internal checksum. If this returns with success then the caller might be able to use functions like Jcat.Context.verify_target() supplying some target checksums.

New in version 0.2.0.

remove_alias_id(id)
Parameters:

id (str) – An item ID alias, typically a file basename

Removes an item alias ID.

New in version 0.1.1.

to_string()
Returns:

string

Return type:

str

Converts the Jcat.Item to a string.

New in version 0.1.0.