File: test-install.py

package info (click to toggle)
gnome-packagekit 3.30.0-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 13,516 kB
  • sloc: ansic: 8,550; xml: 129; python: 89; sh: 74; makefile: 23
file content (14 lines) | stat: -rw-r--r-- 431 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import dbus

try:
    bus = dbus.SessionBus()
except dbus.DBusException, e:
    print 'Unable to connect to dbus: %s' % str(e)
    sys.exit()
try:
    proxy = bus.get_object('org.freedesktop.PackageKit', '/org/freedesktop/PackageKit')
    iface = dbus.Interface(proxy, 'org.freedesktop.PackageKit')
    iface.InstallPackageName('openoffice-clipart')
except dbus.DBusException, e:
    print 'Unable to use PackageKit: %s' % str(e)