summaryrefslogtreecommitdiff
path: root/tests/legacy-app-handler/legacy-app-handler-test
blob: a8d850119b4518e66e699dd77d8f484fcee97cf5 (plain)
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
28
29
30
#!/usr/bin/python

import gobject
import dbus
import dbus.service
import sys

from dbus.mainloop.glib import DBusGMainLoop


class TestService(dbus.service.Object):

    def __init__(self, name):
        bus_name = dbus.service.BusName(
            'org.genivi.NodeStartupController1.LegacyAppHandler.%s' % name,
            bus=dbus.SystemBus())
        path = '/org/genivi/NodeStartupController1/LegacyAppHandler/%s' % name
        dbus.service.Object.__init__(self, bus_name, path)

    @dbus.service.method('org.genivi.NodeStartupController1.'
                         'LegacyAppHandler.Test')
    def hello(self):
        return "Hello World!"


if __name__ == '__main__':
    DBusGMainLoop(set_as_default=True)
    service = TestService(sys.argv[1])
    loop = gobject.MainLoop()
    loop.run()