aboutsummaryrefslogtreecommitdiffstats
path: root/examples/dbus/test_signal_simple.py
blob: 6f077cc433e735c1d5d3ad1e19315f45e6ef7473 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/bin/env python

import dbus
from efl import dbus_mainloop
from efl import ecore


def print_name_owner_changed(obj, old, new):
    print("Obj = '%s', Old = '%s', New = '%s'" % (obj, old, new))


dbus_ml = dbus_mainloop.DBusEcoreMainLoop()
bus = dbus.SystemBus(mainloop=dbus_ml)

bus.add_signal_receiver(print_name_owner_changed, "NameOwnerChanged")
ecore.main_loop_begin()