#!/usr/bin/env python3

from twisted.internet import reactor, defer

from txdbus import client, error


@defer.inlineCallbacks
def main():

    try:
        cli   = yield client.connect(reactor)

        userid  = yield cli.getConnectionUnixUser( 'org.example' )

        print 'User of org.example: ', userid

    except error.DBusException, e:
        print 'DBus Error:', e

    reactor.stop()

                
reactor.callWhenRunning(main)
reactor.run()
