| 1 |
import dbus |
| 2 |
|
| 3 |
try: |
| 4 |
bus = dbus.SessionBus() |
| 5 |
except dbus.DBusException, e: |
| 6 |
print 'Unable to connect to dbus: %s' % str(e) |
| 7 |
sys.exit() |
| 8 |
try: |
| 9 |
proxy = bus.get_object('org.freedesktop.PackageKit', '/org/freedesktop/PackageKit') |
| 10 |
iface = dbus.Interface(proxy, 'org.freedesktop.PackageKit.Modify') |
| 11 |
iface.InstallPackageNames(dbus.UInt32(0), ["openoffice-clipart", "openoffice-clipart-extras"], "show-confirm-search,hide-finished") |
| 12 |
except dbus.DBusException, e: |
| 13 |
print 'Unable to use PackageKit: %s' % str(e) |