Changes between Version 2 and Version 3 of Development/UiClient1.2
- Timestamp:
- 02/11/2009 12:02:18 AM (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Development/UiClient1.2
v2 v3 60 60 def on_connect_success(result): 61 61 print "Connection was successful!" 62 def on_get_config_value( key, value):62 def on_get_config_value(value, key): 63 63 print "Got config value from the daemon!" 64 64 print "%s: %s" % (key, value) … … 73 73 }}} 74 74 75 Ok! We now should be getting a print out of the ''download_location'' config value. You'll notice that any RPC method returns a Deferred object, just like the '''client.connect()''' method. Since the '''core.get_config_value()''' method only returns the value we are passing the ''key'' to the callback function too. So in the '''on_get_config_value()''' callback, the first argument is from our '''addCallback()''' call and the second is the return value from the daemon.75 Ok! We now should be getting a print out of the ''download_location'' config value. You'll notice that any RPC method returns a Deferred object, just like the '''client.connect()''' method. Since the '''core.get_config_value()''' method only returns the value we are passing the ''key'' to the callback function too. So in the '''on_get_config_value()''' callback, the first argument is the return value from the daemon and the second is from our '''addCallback()''' call. 76 76