#!/usr/bin/python #SPDX license identifier: MPL-2.0 # #Copyright (C) 2012, GENIVI # #This file is part of node-startup-controller. # #This Source Code Form is subject to the terms of the #Mozilla Public License (MPL), v. 2.0. #If a copy of the MPL was not distributed with this file, #You can obtain one at http://mozilla.org/MPL/2.0/. # #For further information see http://www.genivi.org/. # #List of changes: #2015-04-30, Jonathan Maw, List of changes started 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()