#!/usr/bin/python

import dbus
import dbus.exceptions
import dbus.mainloop.glib
import dbus.service

try:
    from gi.repository import GObject  # python3
except ImportError:
    import gobject as GObject  # python2

mainloop = None

MULBERRY_SERVICE_NAME = 'io.mulberry'
MANAGER_IFACE = 'io.mulberry.Manager'
DEVICE_IFACE = 'io.mulberry.Device'
RESOURCE_IFACE = 'io.mulberry.Resource'

DBUS_OM_IFACE = 'org.freedesktop.DBus.ObjectManager'
DBUS_PROP_IFACE = 'org.freedesktop.DBus.Properties'

def main():
    global mainloop

    dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)

    bus = dbus.SystemBus()

    manager = dbus.Interface(bus.get_object(MULBERRY_SERVICE_NAME, '/'), MANAGER_IFACE)

    # Add sample device
    # - name, device type
    path = manager.AddDevice("myclient", "client", "oic.wk.d")

    manager.StartService()
    mainloop = GObject.MainLoop()
    mainloop.run()

if __name__ == '__main__':
    main()

c3b854a75ee56aabe85af5f5c0f125664074070f
<mask token>


def main():
    global mainloop
    dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
    bus = dbus.SystemBus()
    manager = dbus.Interface(bus.get_object(MULBERRY_SERVICE_NAME, '/'),
        MANAGER_IFACE)
    path = manager.AddDevice('myclient', 'client', 'oic.wk.d')
    manager.StartService()
    mainloop = GObject.MainLoop()
    mainloop.run()


<mask token>

<mask token>
try:
    from gi.repository import GObject
except ImportError:
    import gobject as GObject
<mask token>


def main():
    global mainloop
    dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
    bus = dbus.SystemBus()
    manager = dbus.Interface(bus.get_object(MULBERRY_SERVICE_NAME, '/'),
        MANAGER_IFACE)
    path = manager.AddDevice('myclient', 'client', 'oic.wk.d')
    manager.StartService()
    mainloop = GObject.MainLoop()
    mainloop.run()


if __name__ == '__main__':
    main()

<mask token>
try:
    from gi.repository import GObject
except ImportError:
    import gobject as GObject
mainloop = None
MULBERRY_SERVICE_NAME = 'io.mulberry'
MANAGER_IFACE = 'io.mulberry.Manager'
DEVICE_IFACE = 'io.mulberry.Device'
RESOURCE_IFACE = 'io.mulberry.Resource'
DBUS_OM_IFACE = 'org.freedesktop.DBus.ObjectManager'
DBUS_PROP_IFACE = 'org.freedesktop.DBus.Properties'


def main():
    global mainloop
    dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
    bus = dbus.SystemBus()
    manager = dbus.Interface(bus.get_object(MULBERRY_SERVICE_NAME, '/'),
        MANAGER_IFACE)
    path = manager.AddDevice('myclient', 'client', 'oic.wk.d')
    manager.StartService()
    mainloop = GObject.MainLoop()
    mainloop.run()


if __name__ == '__main__':
    main()

import dbus
import dbus.exceptions
import dbus.mainloop.glib
import dbus.service
try:
    from gi.repository import GObject
except ImportError:
    import gobject as GObject
mainloop = None
MULBERRY_SERVICE_NAME = 'io.mulberry'
MANAGER_IFACE = 'io.mulberry.Manager'
DEVICE_IFACE = 'io.mulberry.Device'
RESOURCE_IFACE = 'io.mulberry.Resource'
DBUS_OM_IFACE = 'org.freedesktop.DBus.ObjectManager'
DBUS_PROP_IFACE = 'org.freedesktop.DBus.Properties'


def main():
    global mainloop
    dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
    bus = dbus.SystemBus()
    manager = dbus.Interface(bus.get_object(MULBERRY_SERVICE_NAME, '/'),
        MANAGER_IFACE)
    path = manager.AddDevice('myclient', 'client', 'oic.wk.d')
    manager.StartService()
    mainloop = GObject.MainLoop()
    mainloop.run()


if __name__ == '__main__':
    main()

#!/usr/bin/python

import dbus
import dbus.exceptions
import dbus.mainloop.glib
import dbus.service

try:
    from gi.repository import GObject  # python3
except ImportError:
    import gobject as GObject  # python2

mainloop = None

MULBERRY_SERVICE_NAME = 'io.mulberry'
MANAGER_IFACE = 'io.mulberry.Manager'
DEVICE_IFACE = 'io.mulberry.Device'
RESOURCE_IFACE = 'io.mulberry.Resource'

DBUS_OM_IFACE = 'org.freedesktop.DBus.ObjectManager'
DBUS_PROP_IFACE = 'org.freedesktop.DBus.Properties'

def main():
    global mainloop

    dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)

    bus = dbus.SystemBus()

    manager = dbus.Interface(bus.get_object(MULBERRY_SERVICE_NAME, '/'), MANAGER_IFACE)

    # Add sample device
    # - name, device type
    path = manager.AddDevice("myclient", "client", "oic.wk.d")

    manager.StartService()
    mainloop = GObject.MainLoop()
    mainloop.run()

if __name__ == '__main__':
    main()
