Conduit & Mobile Devices - Week 5
- From: "John Stowers" <john stowers gmail com>
- To: gnome-soc-list <gnome-soc-list gnome org>
- Subject: Conduit & Mobile Devices - Week 5
- Date: Thu, 3 Jul 2008 00:03:25 +1200
Hey Team,
Apologies for a few days late, I have been preparing for GUADEC and my
talk, etc. This week I was able to successfully run the first
libsyncml test from python (i.e. a port of one of the C libsyncml test
cases to python). This is significant because It showed that the
marshaling of callbacks between libsyncml and python now seems to be
working - at least to some extent. It also obviously implies that most
of the rest of the autogenerated binding is doing the right thing, and
I have sufficient API coverage (>>90%) to actually do the useful
stuff.
The depressingly short piece of code is
import syncml
def manager_cb(eventType, session):
print "CALLBACK ", eventType
c = syncml.Transport(syncml.SML_TRANSPORT_HTTP_CLIENT)
s = syncml.Transport(syncml.SML_TRANSPORT_HTTP_SERVER)
c.SetConfigOption("URL", "http://127.0.0.1:12020")
s.SetConfigOption("PORT","12020")
cm = syncml.Manager(c)
cm.SetEventCallback(manager_cb)
sm = syncml.Manager(s)
sm.SetEventCallback(manager_cb)
c.Initialize()
s.Initialize()
cm.Start()
sm.Start()
datastr = "<SyncML></SyncML>"
data = syncml.TransportData(datastr, len(datastr),
syncml.SML_MIMETYPE_XML, False)
c.Send(data)
while 1:
sm.Dispatch()
Next week I am not sure what I will do. I will be at GUADEC.
Wahoo!
John
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]