Changes between Version 2 and Version 3 of Development/UiClient1.2


Ignore:
Timestamp:
02/11/2009 12:02:18 AM (15 years ago)
Author:
andar
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Development/UiClient1.2

    v2 v3  
    6060def on_connect_success(result): 
    6161    print "Connection was successful!" 
    62     def on_get_config_value(key, value): 
     62    def on_get_config_value(value, key): 
    6363        print "Got config value from the daemon!" 
    6464        print "%s: %s" % (key, value) 
     
    7373}}} 
    7474 
    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. 
     75Ok! 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. 
    7676