File: dbus-update-apt-xapian-index.py

package info (click to toggle)
apt-xapian-index 0.45
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 428 kB
  • sloc: python: 2,949; ruby: 475; sh: 130; makefile: 34
file content (25 lines) | stat: -rw-r--r-- 564 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/python

import dbus
import os
import glib
import dbus.mainloop.glib
dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)

def finished(res):
	print "finished: ", res

def progress(percent):
	print "progress: ", percent

system_bus = dbus.SystemBus()

axi = dbus.Interface(system_bus.get_object("org.debian.AptXapianIndex","/"),
                     "org.debian.AptXapianIndex")
axi.connect_to_signal("UpdateFinished", finished)
axi.connect_to_signal("UpdateProgress", progress)
# force, update_only
axi.update_async(True, True)

glib.MainLoop().run()