dcorking / google-wave-resources

Automatically exported from code.google.com/p/google-wave-resources
0 stars 0 forks source link

Bug: inaccurate documentation for Python Element class #817

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
The Element documentation refers to image.properties['url'] which doesn't 
actually work, the attribute's name is _properties with leading underscore and 
presumably intended to be internal. The documentation should say:

  ... and through the get() method (image.get('url'))

I ran across this when iterating across blip.elements, the blip contained a 
LINE element with no attributes, causing elem.name to fail with a "no such 
attribute" error. The get() method returns None in that case.

See 
http://wave-robot-python-client.googlecode.com/svn/trunk/pydocs/index.html#modul
e-element

class element.Element(element_type, **properties)
[..]
Properties of elements are both accessible directly (image.url) and through the 
properties dictionary (image.properties[‘url’]). In general Element should 
not be instantiated by robots, but rather rely on the derived classes.

Original issue reported on code.google.com by Klaus.We...@gmail.com on 26 Jun 2010 at 9:12

GoogleCodeExporter commented 8 years ago
Thanks, will be fixed in next release.

Original comment by pamela.fox on 8 Jul 2010 at 12:47

GoogleCodeExporter commented 8 years ago
Fixed:

http://wave-robot-python-client.googlecode.com/svn/trunk/pydocs/index.html#eleme
nt.Element

Original comment by pamela.fox on 8 Jul 2010 at 5:07