PackageKitGlib.PackageSack¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
Properties¶
None
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent |
r |
||
priv |
r |
Class Details¶
- class PackageKitGlib.PackageSack(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod new()¶
- Returns:
a new
PackageKitGlib.PackageSack
object.- Return type:
New in version 0.5.2.
- add_package(package)¶
- Parameters:
package (
PackageKitGlib.Package
) – a validPackageKitGlib.Package
instance- Returns:
True
if the package was added to the sack- Return type:
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:
- Returns:
True
if the package was added to the sack- Return type:
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:
- Returns:
True
if there were no errors.- Return type:
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:
filter_cb (
PackageKitGlib.PackageSackFilterFunc
) – aPackageKitGlib.PackageSackFilterFunc
, which returnsTrue
for thePackageKitGlib.Package
's to add
- Returns:
a new
PackageKitGlib.PackageSack
, free withGObject.Object.unref
()- Return type:
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
) – aPackageKitGlib.InfoEnum
value to match- Returns:
a new
PackageKitGlib.PackageSack
, free withGObject.Object.unref
()- Return type:
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, orNone
if unfound. Free withGObject.Object.unref
()- Return type:
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, orNone
if not found.- Return type:
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:
Gets the package array from the sack
New in version 0.6.1.
- get_details(cancellable)¶
- Parameters:
cancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
orNone
- Raises:
- Returns:
True
if the properties were set correctly- Return type:
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:
cancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
orNone
progress_callback (
PackageKitGlib.ProgressCallback
) – the function to run when the progress changesprogress_user_data (
object
orNone
) – data to pass to progress_callbackcallback (
Gio.AsyncReadyCallback
orNone
) – the function to run on completion
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:
Gets the number of packages in the sack
New in version 0.5.2.
- get_total_bytes()¶
- Returns:
the size in bytes
- Return type:
Gets the total size of the package sack in bytes.
New in version 0.5.2.
- get_update_detail(cancellable)¶
- Parameters:
cancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
orNone
- Raises:
- Returns:
True
if the properties were set correctly- Return type:
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:
cancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
orNone
progress_callback (
PackageKitGlib.ProgressCallback
) – the function to run when the progress changesprogress_user_data (
object
orNone
) – data to pass to progress_callbackcallback (
Gio.AsyncReadyCallback
orNone
) – the function to run on completion
Merges in update details about packages.
New in version 0.5.2.
- merge_generic_finish(res)¶
- Parameters:
res (
Gio.AsyncResult
) – theGio.AsyncResult
- Raises:
- Returns:
True
for success- Return type:
Gets the result from the asynchronous function.
New in version 0.5.2.
- remove_by_filter(filter_cb, *user_data)¶
- Parameters:
filter_cb (
PackageKitGlib.PackageSackFilterFunc
) – aPackageKitGlib.PackageSackFilterFunc
, which returnsTrue
for thePackageKitGlib.Package
's to retain
- Returns:
True
if a package was removed from the sack- Return type:
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 validPackageKitGlib.Package
instance- Returns:
True
if the package was removed from the sack- Return type:
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:
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
orNone
) – aGio.Cancellable
orNone
- Raises:
- Returns:
True
if the properties were set correctly- Return type:
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:
cancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
orNone
progress_callback (
PackageKitGlib.ProgressCallback
) – the function to run when the progress changesprogress_user_data (
object
orNone
) – data to pass to progress_callbackcallback (
Gio.AsyncReadyCallback
orNone
) – the function to run on completion
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:
- Returns:
True
if there were no errors.- Return type:
Write the contents of a
PackageKitGlib.PackageSack
to a package-list file.New in version 0.8.6.
- do_changed() virtual¶