PackageKitGlib.PackageSack

g GObject.Object GObject.Object PackageKitGlib.PackageSack PackageKitGlib.PackageSack GObject.Object->PackageKitGlib.PackageSack

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new ()

add_package (package)

add_package_by_id (package_id)

add_packages_from_file (file)

clear ()

filter (filter_cb, *user_data)

filter_by_info (info)

find_by_id (package_id)

find_by_id_name_arch (package_id)

get_array ()

get_details (cancellable)

get_details_async (cancellable, progress_callback, progress_user_data, callback, *user_data)

get_ids ()

get_size ()

get_total_bytes ()

get_update_detail (cancellable)

get_update_detail_async (cancellable, progress_callback, progress_user_data, callback, *user_data)

merge_generic_finish (res)

remove_by_filter (filter_cb, *user_data)

remove_package (package)

remove_package_by_id (package_id)

resolve (cancellable)

resolve_async (cancellable, progress_callback, progress_user_data, callback, *user_data)

sort (type)

to_file (file)

Virtual Methods

Inherited:

GObject.Object (7)

do_changed ()

Properties

None

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent

GObject.Object

r

priv

PackageKitGlib.PackageSackPrivate

r

Class Details

class PackageKitGlib.PackageSack(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

PackageKitGlib.PackageSackClass

classmethod new()
Returns:

a new PackageKitGlib.PackageSack object.

Return type:

PackageKitGlib.PackageSack

New in version 0.5.2.

add_package(package)
Parameters:

package (PackageKitGlib.Package) – a valid PackageKitGlib.Package instance

Returns:

True if the package was added to the sack

Return type:

bool

Adds a package to the sack.

New in version 0.5.2.

add_package_by_id(package_id)
Parameters:

package_id (str) – a package_id descriptor

Raises:

GLib.Error

Returns:

True if the package was added to the sack

Return type:

bool

Adds a package reference to the sack.

New in version 0.5.2.

add_packages_from_file(file)
Parameters:

file (Gio.File) – a valid package-list file

Raises:

GLib.Error

Returns:

True if there were no errors.

Return type:

bool

Adds packages from package-list file to a PackageKitGlib.PackageSack.

clear()

Empty all the packages from the sack

New in version 0.5.2.

filter(filter_cb, *user_data)
Parameters:
Returns:

a new PackageKitGlib.PackageSack, free with GObject.Object.unref()

Return type:

PackageKitGlib.PackageSack

Returns a new package sack which only matches packages that return True from the filter function.

New in version 0.6.3.

filter_by_info(info)
Parameters:

info (PackageKitGlib.InfoEnum) – a PackageKitGlib.InfoEnum value to match

Returns:

a new PackageKitGlib.PackageSack, free with GObject.Object.unref()

Return type:

PackageKitGlib.PackageSack

Returns a new package sack which only matches packages that match the specified info enum value.

New in version 0.6.2.

find_by_id(package_id)
Parameters:

package_id (str) – a package_id descriptor

Returns:

the PackageKitGlib.Package object, or None if unfound. Free with GObject.Object.unref()

Return type:

PackageKitGlib.Package

Finds a package in a sack from reference. As soon as one package is found the search is stopped.

New in version 0.5.2.

find_by_id_name_arch(package_id)
Parameters:

package_id (str) – a package_id descriptor

Returns:

the PackageKitGlib.Package object, or None if not found.

Return type:

PackageKitGlib.Package

Finds a package in a sack by package name and architecture. As soon as one package is found the search is stopped.

New in version 0.8.16.

get_array()
Returns:

A GLib.PtrArray, free with g_ptr_array_unref().

Return type:

[PackageKitGlib.Package]

Gets the package array from the sack

New in version 0.6.1.

get_details(cancellable)
Parameters:

cancellable (Gio.Cancellable or None) – a Gio.Cancellable or None

Raises:

GLib.Error

Returns:

True if the properties were set correctly

Return type:

bool

Gets the properties the daemon supports. Warning: this function is synchronous, and may block. Do not use it in GUI applications.

New in version 0.6.0.

get_details_async(cancellable, progress_callback, progress_user_data, callback, *user_data)
Parameters:

Merges in details about packages.

get_ids()
Returns:

the number of packages in the sack, free with GLib.strfreev()

Return type:

[str]

Returns all the Package IDs in the sack

New in version 0.5.3.

get_size()
Returns:

the number of packages in the sack

Return type:

int

Gets the number of packages in the sack

New in version 0.5.2.

get_total_bytes()
Returns:

the size in bytes

Return type:

int

Gets the total size of the package sack in bytes.

New in version 0.5.2.

get_update_detail(cancellable)
Parameters:

cancellable (Gio.Cancellable or None) – a Gio.Cancellable or None

Raises:

GLib.Error

Returns:

True if the properties were set correctly

Return type:

bool

Gets the properties the daemon supports. Warning: this function is synchronous, and may block. Do not use it in GUI applications.

New in version 0.6.0.

get_update_detail_async(cancellable, progress_callback, progress_user_data, callback, *user_data)
Parameters:

Merges in update details about packages.

New in version 0.5.2.

merge_generic_finish(res)
Parameters:

res (Gio.AsyncResult) – the Gio.AsyncResult

Raises:

GLib.Error

Returns:

True for success

Return type:

bool

Gets the result from the asynchronous function.

New in version 0.5.2.

remove_by_filter(filter_cb, *user_data)
Parameters:
Returns:

True if a package was removed from the sack

Return type:

bool

Removes from the package sack any packages that return False from the filter function.

New in version 0.6.3.

remove_package(package)
Parameters:

package (PackageKitGlib.Package) – a valid PackageKitGlib.Package instance

Returns:

True if the package was removed from the sack

Return type:

bool

Removes a package reference from the sack. The pointers have to match exactly.

New in version 0.5.2.

remove_package_by_id(package_id)
Parameters:

package_id (str) – a package_id descriptor

Returns:

True if the package was removed from the sack

Return type:

bool

Removes a package reference from the sack. As soon as one package is removed the search is stopped.

New in version 0.5.2.

resolve(cancellable)
Parameters:

cancellable (Gio.Cancellable or None) – a Gio.Cancellable or None

Raises:

GLib.Error

Returns:

True if the properties were set correctly

Return type:

bool

Gets the properties the daemon supports. Warning: this function is synchronous, and may block. Do not use it in GUI applications.

New in version 0.6.0.

resolve_async(cancellable, progress_callback, progress_user_data, callback, *user_data)
Parameters:

Merges in details about packages using resolve.

New in version 0.5.2.

sort(type)
Parameters:

type (PackageKitGlib.PackageSackSortType) – the type of sorting, e.g. PackageKitGlib.PackageSackSortType.NAME

Sorts the package sack

New in version 0.6.1.

to_file(file)
Parameters:

file (Gio.File) – a valid package-list file

Raises:

GLib.Error

Returns:

True if there were no errors.

Return type:

bool

Write the contents of a PackageKitGlib.PackageSack to a package-list file.

New in version 0.8.6.

do_changed() virtual