Announcemnet: PyGTK PackageKit

Category: Ubuntu

Recently I added support for asynchronous operations to the Python client of PackageKit. And on top of this a set of PyGTK widgets which make using PackageKit quite comfortable. The code is part of today's 0.3.10 release.

The following widgets help to visualise the status and progress of a transaction:

* PackageKitStatusIcon
* PackageKitStatusAnimation
* PackageKitStatusLabel
* PackageKitProgressBar
* PackageKitCancelButton - allows to cancel a running transaction
* PackageKitProgressDialog - provides an all-in-one solution of the above widgets
* PackageKitMessageDialog - presents messages and errors from PackageKit

Here you can see a video of the demo application in action. As a prove of concept I replaced the call of Synaptic in gnome-app-install by PackageKit. Here is the corresponding screencast.

The following code snippet installs the package xterm with a graphical progress dialog:

from packagekit.client import PackageKitClient
from packagekit.gtkwidgets import PackageKitProgressDialog
from packagekit.enums import *

def on_exit(trans, exit, runtime):
    '''Handle exit state of a transaction e.g. erros or EULAs'''
    pass
# Initialize the client
pk = PackageKitClient()
# Get packages which provide xterm
packages = pk.Resolve(FILTER_NONE, "xterm")
# Setup the transaction to install the first package
trans = pk.InstallPackages([packages[0].id], exit_handler=on_exit)
# Initialize the dialog window
dia = PackageKitProgressDialog()
# Connect the transaction to the dialog and run it
dia.set_transaction(trans)
dia.run()

The API is not yet set into stone. So I am open for comments and feedback!

 
  1. Sebastian Heinlein

    Thursday, 13-11-08 22:00

    I will update the packages at this weekend.
  2. David Nielsen

    Wednesday, 12-11-08 23:37

    Any hope for the PPA packages to be updated to the latest PK release. I am seeing a few issues with the current ones (incidently where do you take bugreports, launchpad doesn't allow bugs against ppas strange a beast as it is)
  3. Sebastian Heinlein

    Wednesday, 12-11-08 16:54

    Anjunta wants to use PackageKit too. Furthermore you have to consider that PackageKit is not (yet) in main.

    The mapping of the modules/plugins and the package files should be kept in a separate header or data file, which gets patched by the distribution to fit its namespace.

    Just write to the PackageKit mailing lsit.
    packagekit
  4. Jason Taylor

    Tuesday, 11-11-08 23:52

    That looks very nice... I havnt really looked into the api much yet, but for rapache we would like to be able to install apache modules can you search with wild cards like apt-file ?
 

CAPTCHA image for SPAM prevention