Ed Tanous | c9b5521 | 2017-06-12 13:25:51 -0700 | [diff] [blame] | 1 | # Copyright (c) Benjamin Kietzman (github.com/bkietz) |
| 2 | # |
| 3 | # Distributed under the Boost Software License, Version 1.0. (See accompanying |
| 4 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) |
| 5 | |
| 6 | import dbus |
| 7 | from dbus.mainloop.glib import DBusGMainLoop |
| 8 | from gobject import MainLoop |
| 9 | |
| 10 | bus_name = 'com.example.Sample' |
| 11 | session_bus = dbus.SessionBus(mainloop=DBusGMainLoop()) |
| 12 | |
| 13 | example_remote = session_bus.get_object(bus_name, '/path/to/obj') |
| 14 | example = dbus.Interface(example_remote, bus_name+'.Iface') |
| 15 | |
| 16 | example.StringifyVariant(123) |
| 17 | print example.GetLastInput() |
| 18 | |
| 19 | MainLoop().run() |