PackageKitGlib.Package

g GObject.Object GObject.Object PackageKitGlib.Source PackageKitGlib.Source GObject.Object->PackageKitGlib.Source PackageKitGlib.Package PackageKitGlib.Package PackageKitGlib.Source->PackageKitGlib.Package

Subclasses:

None

Methods

Inherited:

PackageKitGlib.Source (1), GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

id_build (name, version, arch, data)

class

id_check (package_id)

class

id_equal_fuzzy_arch (package_id1, package_id2)

class

id_split (package_id)

class

id_to_printable (package_id)

class

ids_add_id (package_ids, package_id)

class

ids_add_ids (package_ids, package_ids_new)

class

ids_check (package_ids)

class

ids_from_id (package_id)

class

ids_from_string (package_id)

class

ids_present_id (package_ids, package_id)

class

ids_remove_id (package_ids, package_id)

class

ids_to_string (package_ids)

class

new ()

equal (package2)

equal_id (package2)

get_arch ()

get_data ()

get_id ()

get_info ()

get_name ()

get_summary ()

get_update_severity ()

get_version ()

parse (data)

print_ ()

set_id (package_id)

set_info (info)

set_summary (summary)

set_update_severity (update_severity)

Virtual Methods

Inherited:

GObject.Object (7)

do_changed ()

Properties

Inherited:

PackageKitGlib.Source (2)

Name

Type

Flags

Short Description

description

str

r/w

The package description

group

PackageKitGlib.GroupEnum

r/w

The package group

info

PackageKitGlib.InfoEnum

r/w

The PackageKitGlib.InfoEnum package type, e.g. PackageKitGlib.InfoEnum.NORMAL

license

str

r/w

The package license

package-id

str

r

The full package_id, e.g. ‘gnome-power-manager;0.1.2;i386;fedora’

size

int

r/w

The package size

summary

str

r/w

The package summary

update-bugzilla-urls

[str]

r/w

The update bugzilla URLs

update-changelog

str

r/w

The update ChangeLog

update-cve-urls

[str]

r/w

The update CVE URLs

update-issued

str

r/w

When the update was issued

update-obsoletes

str

r/w

The update packages that are obsoleted

update-restart

PackageKitGlib.RestartEnum

r/w

The update restart type

update-severity

PackageKitGlib.InfoEnum

r/w

Package update severity

update-state

PackageKitGlib.UpdateStateEnum

r/w

The update state

update-text

str

r/w

The update description

update-updated

str

r/w

When the update was last updated

update-updates

str

r/w

The update packages

update-vendor-urls

[str]

r/w

The update vendor URLs

url

str

r/w

The package homepage URL

Signals

Inherited:

GObject.Object (1)

Name

Short Description

changed

The ::changed signal is emitted when the package data may have changed.

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent

PackageKitGlib.Source

r

priv

PackageKitGlib.PackagePrivate

r

Class Details

class PackageKitGlib.Package(**kwargs)
Bases:

PackageKitGlib.Source

Abstract:

No

Structure:

PackageKitGlib.PackageClass

classmethod id_build(name, version, arch, data)
Parameters:
  • name (str) – the package name

  • version (str) – the package version

  • arch (str) – the package architecture

  • data (str) – the package extra data

Returns:

returns a string to form the PackageID.

Return type:

str

Generate a PackageID.

New in version 0.5.0.

classmethod id_check(package_id)
Parameters:

package_id (str) – the PackageID to check

Returns:

True if the PackageID was well formed.

Return type:

bool

Check if a Packageid is well formed.

New in version 0.5.0.

classmethod id_equal_fuzzy_arch(package_id1, package_id2)
Parameters:
  • package_id1 (str) – the first PackageID

  • package_id2 (str) – the second PackageID

Returns:

True if the PackageIDs can be considered equal.

Return type:

bool

Only compare the name, version, and arch, where the architecture will fuzzy match with i*86.

New in version 0.5.0.

classmethod id_split(package_id)
Parameters:

package_id (str) – the ; delimited PackageID to split

Returns:

a GStrv or None if invalid, use GLib.strfreev() to free

Return type:

[str]

Splits a PackageID into the correct number of parts, checking the correct number of delimiters are present.

New in version 0.5.3.

classmethod id_to_printable(package_id)
Parameters:

package_id (str) – the PackageID

Returns:

the name-version.arch formatted string, use GLib.free() to free.

Return type:

str

Formats the PackageID to be printable to the user.

New in version 0.5.2.

classmethod ids_add_id(package_ids, package_id)
Parameters:
  • package_ids (str) – a string array of package_id’s

  • package_id (str) – a single package_id

Returns:

the new list, free GLib.strfreev()

Return type:

[str]

Adds a package_id to an existing list.

New in version 0.5.2.

classmethod ids_add_ids(package_ids, package_ids_new)
Parameters:
  • package_ids (str) – a string array of package_id’s

  • package_ids_new (str) – a string array of package_id’s

Returns:

the new list, free GLib.strfreev()

Return type:

[str]

Adds a package_id to an existing list.

New in version 0.5.2.

classmethod ids_check(package_ids)
Parameters:

package_ids (str) – a string array of package_id’s

Returns:

True if the package_ids are all valid.

Return type:

bool

Check the string array of package_id’s for validity

New in version 0.5.2.

classmethod ids_from_id(package_id)
Parameters:

package_id (str) – A single package_id

Returns:

the string array, or None if invalid, free with GLib.strfreev()

Return type:

[str]

Form a composite string array of package_id’s from a single package_id

New in version 0.5.2.

classmethod ids_from_string(package_id)
Parameters:

package_id (str) – A single package_id

Returns:

the string array, or None if invalid, free with GLib.strfreev()

Return type:

[str]

Form a composite string array of package_id’s from a delimited string

New in version 0.5.2.

classmethod ids_present_id(package_ids, package_id)
Parameters:
  • package_ids (str) – a string array of package_id’s

  • package_id (str) – a single package_id

Returns:

True if the package ID is present

Return type:

bool

Finds out if a package ID is present in the list.

New in version 0.5.2.

classmethod ids_remove_id(package_ids, package_id)
Parameters:
  • package_ids (str) – a string array of package_id’s

  • package_id (str) – a single package_id

Returns:

the new list, free GLib.strfreev()

Return type:

[str]

Removes a package ID from the the list.

New in version 0.5.2.

classmethod ids_to_string(package_ids)
Parameters:

package_ids (str) – a string array of package_id’s

Returns:

a string representation of all the package_id’s.

Return type:

str

Cats the string array of package_id’s into one delimited string

New in version 0.5.2.

classmethod new()
Returns:

a new PackageKitGlib.Package object.

Return type:

PackageKitGlib.Package

New in version 0.5.4.

equal(package2)
Parameters:

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

Returns:

True if the packages have the same package_id, info and summary.

Return type:

bool

Do the PackageKitGlib.Package's have the same ID.

New in version 0.5.4.

equal_id(package2)
Parameters:

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

Returns:

True if the packages have the same package_id.

Return type:

bool

Do the PackageKitGlib.Package's have the same ID.

New in version 0.5.4.

get_arch()
Returns:

the arch, or None if unset

Return type:

str

Gets the package arch.

New in version 0.6.4.

get_data()
Returns:

the data, or None if unset

Return type:

str

Gets the package data, which is usually the repository ID that contains the package. Special ID’s include “installed” for installed packages, and “local” for local packages that exist on disk but not in a repository.

New in version 0.6.4.

get_id()
Returns:

the ID, or None if unset

Return type:

str

Gets the package object ID

New in version 0.5.4.

get_info()
Returns:

the PackageKitGlib.InfoEnum

Return type:

PackageKitGlib.InfoEnum

Gets the package object ID

New in version 0.5.4.

get_name()
Returns:

the name, or None if unset

Return type:

str

Gets the package name.

New in version 0.6.4.

get_summary()
Returns:

the summary, or None if unset

Return type:

str

Gets the package object ID

New in version 0.5.4.

get_update_severity()
Returns:

the self update severity, if known.

Return type:

PackageKitGlib.InfoEnum

Returns the self update severity. Can be one of PackageKitGlib.InfoEnum.UNKNOWN, PackageKitGlib.InfoEnum.LOW, PackageKitGlib.InfoEnum.NORMAL, PackageKitGlib.InfoEnum.IMPORTANT or PackageKitGlib.InfoEnum.CRITICAL.

New in version 1.2.4.

get_version()
Returns:

the version, or None if unset

Return type:

str

Gets the package version.

New in version 0.6.4.

parse(data)
Parameters:

data (str) – the data describing the package

Raises:

GLib.Error

Returns:

True if the data was parsed correcty

Return type:

bool

Parses the data to populate the PackageKitGlib.Package.

New in version 0.8.11.

print_()

Prints details about the package to standard out.

New in version 0.5.4.

set_id(package_id)
Parameters:

package_id (str) – the valid package_id

Raises:

GLib.Error

Returns:

True if the package_id was set

Return type:

bool

Sets the package object to have the given ID

New in version 0.5.4.

set_info(info)
Parameters:

info (PackageKitGlib.InfoEnum) – the PackageKitGlib.InfoEnum

Sets the package info enum.

New in version 0.8.14.

set_summary(summary)
Parameters:

summary (str) – the package summary

Sets the package summary.

New in version 0.8.14.

set_update_severity(update_severity)
Parameters:

update_severity (PackageKitGlib.InfoEnum) – a PackageKitGlib.InfoEnum

Set an update severity for the self. The update_severity can be one of PackageKitGlib.InfoEnum.UNKNOWN, PackageKitGlib.InfoEnum.LOW, PackageKitGlib.InfoEnum.NORMAL, PackageKitGlib.InfoEnum.IMPORTANT or PackageKitGlib.InfoEnum.CRITICAL.

New in version 1.2.4.

do_changed() virtual

Signal Details

PackageKitGlib.Package.signals.changed(package)
Signal Name:

changed

Flags:

RUN_LAST

Parameters:

package (PackageKitGlib.Package) – The object which received the signal

The ::changed signal is emitted when the package data may have changed.

Property Details

PackageKitGlib.Package.props.description
Name:

description

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

The package description

New in version 0.5.4.

PackageKitGlib.Package.props.group
Name:

group

Type:

PackageKitGlib.GroupEnum

Default Value:

PackageKitGlib.GroupEnum.UNKNOWN

Flags:

READABLE, WRITABLE

The package group

New in version 0.5.4.

PackageKitGlib.Package.props.info
Name:

info

Type:

PackageKitGlib.InfoEnum

Default Value:

PackageKitGlib.InfoEnum.UNKNOWN

Flags:

READABLE, WRITABLE

The PackageKitGlib.InfoEnum package type, e.g. PackageKitGlib.InfoEnum.NORMAL

New in version 0.5.4.

PackageKitGlib.Package.props.license
Name:

license

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

The package license

New in version 0.5.4.

PackageKitGlib.Package.props.package_id
Name:

package-id

Type:

str

Default Value:

None

Flags:

READABLE

The full package_id, e.g. ‘gnome-power-manager;0.1.2;i386;fedora’

New in version 0.5.4.

PackageKitGlib.Package.props.size
Name:

size

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE

The package size

New in version 0.5.4.

PackageKitGlib.Package.props.summary
Name:

summary

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

The package summary

New in version 0.5.4.

PackageKitGlib.Package.props.update_bugzilla_urls
Name:

update-bugzilla-urls

Type:

[str]

Default Value:

[]

Flags:

READABLE, WRITABLE

The update bugzilla URLs

New in version 0.8.1.

PackageKitGlib.Package.props.update_changelog
Name:

update-changelog

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

The update ChangeLog

New in version 0.5.4.

PackageKitGlib.Package.props.update_cve_urls
Name:

update-cve-urls

Type:

[str]

Default Value:

[]

Flags:

READABLE, WRITABLE

The update CVE URLs

New in version 0.8.1.

PackageKitGlib.Package.props.update_issued
Name:

update-issued

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

When the update was issued

New in version 0.5.4.

PackageKitGlib.Package.props.update_obsoletes
Name:

update-obsoletes

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

The update packages that are obsoleted

New in version 0.5.4.

PackageKitGlib.Package.props.update_restart
Name:

update-restart

Type:

PackageKitGlib.RestartEnum

Default Value:

PackageKitGlib.RestartEnum.UNKNOWN

Flags:

READABLE, WRITABLE

The update restart type

New in version 0.5.4.

PackageKitGlib.Package.props.update_severity
Name:

update-severity

Type:

PackageKitGlib.InfoEnum

Default Value:

PackageKitGlib.InfoEnum.UNKNOWN

Flags:

READABLE, WRITABLE

Can be one of PackageKitGlib.InfoEnum.UNKNOWN, PackageKitGlib.InfoEnum.LOW, PackageKitGlib.InfoEnum.NORMAL, PackageKitGlib.InfoEnum.IMPORTANT or PackageKitGlib.InfoEnum.CRITICAL.

New in version 1.2.4.

PackageKitGlib.Package.props.update_state
Name:

update-state

Type:

PackageKitGlib.UpdateStateEnum

Default Value:

PackageKitGlib.UpdateStateEnum.UNKNOWN

Flags:

READABLE, WRITABLE

The update state

New in version 0.5.4.

PackageKitGlib.Package.props.update_text
Name:

update-text

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

The update description

New in version 0.5.4.

PackageKitGlib.Package.props.update_updated
Name:

update-updated

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

When the update was last updated

New in version 0.5.4.

PackageKitGlib.Package.props.update_updates
Name:

update-updates

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

The update packages

New in version 0.5.4.

PackageKitGlib.Package.props.update_vendor_urls
Name:

update-vendor-urls

Type:

[str]

Default Value:

[]

Flags:

READABLE, WRITABLE

The update vendor URLs

New in version 0.8.1.

PackageKitGlib.Package.props.url
Name:

url

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

The package homepage URL

New in version 0.5.4.