Hi,
I have some problems with the scriptext Contacts service.
Using the example source code
If the contact "Tom" is really found, the PythonShellScript process doesn't get terminated, even if it is closed using the [Exit] key... (this can be verified using Y-Tasks application) so the application heap eventually gets eaten up till [Out of Memory]...Code:import scriptext import e32 # Using e32.Ao_lock() to make main function wait till callback is hit lock = e32.Ao_lock() # Callback function will be called when the requested service is complete def get_list(trans_id, event_id, input_params): if event_id != scriptext.EventCompleted: # Check the event status print "Error in retrieving required info" print "Error code is: " + str(input_params["ReturnValue"]["ErrorCode"]) if "ErrorMessage" in input_params["ReturnValue"]: print "Error message:" + input_params["ReturnValue"]["ErrorMessage"] else: if 0 != input_params["ErrorCode"]: print "Failed: %d" % input_params["ErrorCode"] else: for contact in input_params["ReturnValue"]: name = u"" # Create the name if "FirstName" in contact: name += contact["FirstName"]["Value"] if "LastName" in contact: if len(name) > 0: name += u" " name += contact["LastName"]["Value"] print "Name: " + name lock.signal() # Load contacts module contacts_handle = scriptext.load("Service.Contact", "IDataSource") event_id = contacts_handle.call('GetList', {'Type': u'Contact', 'Filter':{'SearchVal': u'Tom'}}, callback=get_list) print "Waiting for the request to be processed!" lock.wait() print "Request complete!"
The same seems to happen for a Synchronous process (without using callback) as well
Is it a bug with the "Service.Contact" process? Any quick workarounds to the problem, or ways to wrap the PyS60 1.4.x contacts module to an asynchronous call?
Thanks for any kind help.
(Otherwise, this scriptext service is working great! creating a Contact list of everyone in DB is much more transparent to the user . as it takes around 1 sec to read through my contacts..)


Reply With Quote
behaviour: Using the long version, if i try to create a listA (of results) in for..loop part of the callbackC1 function, it is executed as a background process and I can access parts of the listA from another functionF1 outside.
. I thought previously that the Contact request callback works something like canvas.bind callbacks, which are queued when 2 keys are pressed?

