xref: /openbmc/boost-dbus/test/proxy_sample.py (revision 85362594)
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
6import dbus
7from dbus.mainloop.glib import DBusGMainLoop
8from gobject import MainLoop
9
10bus_name = 'com.example.Sample'
11session_bus = dbus.SessionBus(mainloop=DBusGMainLoop())
12
13example_remote = session_bus.get_object(bus_name, '/path/to/obj')
14example = dbus.Interface(example_remote, bus_name+'.Iface')
15
16example.StringifyVariant(123)
17print example.GetLastInput()
18
19MainLoop().run()
20