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

package info (click to toggle)
apt-xapian-index 0.53
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 424 kB
  • sloc: python: 2,896; ruby: 475; sh: 137; makefile: 31
file content (27 lines) | stat: -rw-r--r-- 612 bytes parent folder | download | duplicates (2)
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
26
27
#!/usr/bin/python3

from __future__ import print_function

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()