Hi Seth,
On May 30, 8:39 pm, "
scov...@google.com" <
scov...@google.com> wrote:
> Hi there. We have every intention of having Java and Python be equal
> in Wave. The current state of tutorials is only due to the Java API
> being developed first. If you look deeper, you will notice that the
> Python API exposes a lower level API of events and operations, while
> the Java API is a little higher level maintaining the "effective"
> state of the Wave on the Robot client. It is our plan to expose both
> layers and even describe the wire protocol such that developers can
> use their language of choice to develop with Wave.
>
I kindly disagree, I got two feeling about this that did not point me
to your conclusion. Please (and I'll really love to be disproved here)
tell me why I'm wrong.
a- This is totally unpythonic. From what I can tell the whole robot-
python-client is coded this way.
def Setup(context):
"""Called when this robot is first added to the wave."""
root_wavelet = context.GetRootWavelet()
root_wavelet.CreateBlip().GetDocument().SetText("I'm alive!")
b- from wave-robot-python-client-read-only/src/waveapi/util.py
def CollapseJavaCollections(data):
"""Collapses the unnecessary extra data structures in the wire
format.
Currently the wire format is built from marshalling of Java objects.
This
introduces overhead of extra key/value pairs with respect to
collections and
superfluous fields. As such, this method attempts to collapse those
structures
out of the data format by collapsing the collection objects and
removing
the java class fields.
This preserves the data that is passed in and only removes the
collection
types.
Args:
data: Some arbitrary dict, list or primitive type.
Returns:
The same data structure with the collapsed and unnecessary objects
removed.
"""
if IsDict(data):
java_class = data.get('javaClass')
if java_class:
del data['javaClass']
if java_class == 'java.util.HashMap':
return CollapseJavaCollections(data['map'])
elif java_class == 'java.util.ArrayList':
return CollapseJavaCollections(data['list'])
for key, val in data.iteritems():
data[key] = CollapseJavaCollections(val)
elif IsListOrDict(data):
for index in range(len(data)):
data[index] = CollapseJavaCollections(data[index])
return data
return data
Those two arguments lead me to believe the python API was build on top
of rather than from the ground up.
This is really sad for me specially because the java version (sadly as
most java) seems total bloatware (just compare the java examples with
the python ones) not to mention that
http://code.google.com/apis/wave/extensions/robots/guide.html
is more a leason on how to make eclipse work than a real tutorial.
Sorry for the tone, this got me really down after 48hrs of O M G