> Since I am learning the python ropes, I have been re-writing the code
> for myself using the contrib files for models.  There doesn't seem to be
> a 'simpleInsert.py' file out there.  I would not mind putting my
> 'simpleInsert.py' out there once I get it working.

Yeah, the insert demo isn't implemented in all languages because the
insert API just finalized. I had lots of complaints with it for a while,
so I didn't want to write a demo which would instantly be outdated and I
would forget to update. I'd be happy to add your demo script when you get
it working. I'd actually prefer that people other than me write these
things because then I'll know if it's a big pain that I'm just used to, or
if it actually is easy. The entire point of the XML-RPC is to make it as
easy as humanly possible for you to write a client.

> When I looked in the java directory there was a file that seemed to want
> to use 'client.simple.insert' although the XML-RPC docs seem to lean
> toward 'client.simple.put'.  There were also flags for [mode]  and
> [port] mentioned for client.simple.insert.  Anyway, I am befuddled and
> hoping for a little nudge in the right direction as to what the call is
> named and looking for.

There are three XML-RPC APIs, as you might have noticed. Simple is the
simplest. Don't try to use it for big files. But it's nice and concise if
you have small files.

So, in python, you want to do:
from xmlrpclib import *
from status import *

client = Server("http://localhost:6690/";)
data = Binary("this is the contents of the file")
client.simple.putFile(sys.argv[2], 20, data)

Just e-mail me off list if you have any other questions or if you think
the API could be improved in any way.

> Anyway, I was successful retrieving data.  As soon as I can insert some
> data using the simple clients, it will be time to move on to the more
> complex clients.

Having used the various APIs a lot, I'd recommend Streaming.



_______________________________________________
Devl mailing list
Devl at freenetproject.org
http://lists.freenetproject.org/mailman/listinfo/devl

Reply via email to