[SAGA-RG] SAGA Python Bindings
Steve Fisher
dr.s.m.fisher at gmail.com
Tue Oct 2 06:03:38 EDT 2012
For SD I have a ServiceDescription with a fixed set of attributes.
These should be read only for the user. The obvious way of doing this
is to use the @Property decorator as in the Parrot example in
http://docs.python.org/library/functions.html#property (the _voltage
can be set of course but voltage can't)
In my case I then have, where sd is a ServiceDescription, sd.uid,
sd.url, sd.name etc. I will also have sd.relatedServices which is a
list which I would always create even if empty to allow people to use
it without checking first.
For the data fields obtained via sd.get_data in the spec I would make
sd.data (also read only) return a dictionary (maybe empty). With this:
"print sd.data" works without any effort. The dictionary will contain
anything you want - but normally it will be simple things like strings
and numbers or lists of them.
I would also suggest not implementing the async stuff in python.
Threads are easy enough for the user to do in python - and you can put
exactly what you want in each thread.
Steve
More information about the saga-rg
mailing list