diff options
author | Johan Hedberg <johan.hedberg@nokia.com> | 2008-06-11 08:44:38 +0000 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@nokia.com> | 2008-06-11 08:44:38 +0000 |
commit | 24e72e94d27fad0b92e3fcf42f0c66b88cb1b495 (patch) | |
tree | a3bc590070ce0a4dcbfc5d89d0ae940e34ed0e8c /hcid | |
parent | f3e25ccb88ded387e6c428038899939f62b07f51 (diff) |
Use separate callback for errors
Diffstat (limited to 'hcid')
-rwxr-xr-x | hcid/simple-agent | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/hcid/simple-agent b/hcid/simple-agent index 80d92d45..6a3a4abd 100755 --- a/hcid/simple-agent +++ b/hcid/simple-agent @@ -59,8 +59,12 @@ class Agent(dbus.service.Object): def Cancel(self): print "Cancel" -def create_device_reply(reply): - print "New device (%s)" % (reply) +def create_device_reply(device): + print "New device (%s)" % (device) + sys.exit(0) + +def create_device_error(error): + print "Creating device failed: %s" % (error) sys.exit(0) if __name__ == '__main__': @@ -90,7 +94,7 @@ if __name__ == '__main__': adapter.CreatePairedDevice(sys.argv[2], path, "DisplayOnly", reply_handler=create_device_reply, - error_handler=create_device_reply) + error_handler=create_device_error) else: adapter.RegisterAgent(path, "DisplayOnly") print "Agent registered" |