pombreda / wave-robot-python-client

Automatically exported from code.google.com/p/wave-robot-python-client
Apache License 2.0
0 stars 0 forks source link

UnboundLocalError: local variable 'props' referenced before assignment #7

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
in r10:

file: /waveapi/document.py

line 197: local variable 'props' referenced before assignment

in function ElementFromJson the problem is that props is only defined if 
etype == ELEMENT_TYPE.GADGET. When etype == ELEMENT_TYPE.IMAGE it is also 
used but not defined before.

 if etype == ELEMENT_TYPE.GADGET:
    props = json['properties'].copy()
    url = props['url']
    del props['url']
    return Gadget(url=url, props=props)
 elif etype == ELEMENT_TYPE.IMAGE:
    return Image(url=props.get('url', ''),
                 width=props.get('width'),
                 height=props.get('height'),
                 attachment_id=props.get('attachment_id'),
                 caption=props.get('caption'))

Original issue reported on code.google.com by dafire@gmail.com on 20 Jul 2009 at 8:58

GoogleCodeExporter commented 9 years ago
this has beed fixed in r11

Original comment by dafire@gmail.com on 21 Jul 2009 at 2:19

GoogleCodeExporter commented 9 years ago
Thanks for the report.

Original comment by artdent on 4 Aug 2009 at 8:14