I think the Parallax get_image and get_image_metadata might need a slight modification. Currently, Parallax returns the JSON with the form dict(image=image_info) or dict(images=image_list). So, you probably want to
(The reason I return the json as dict(image=image_info) rather than just returning the image_info as a dict directly-- as would make sense-- is that, when we do support XML, we'll need a name for the root tag. By doing it this way, JSON and XML can be derived from the exact same dict-representation.)
Overall, looks excellent.
I think the Parallax get_image and get_image_metadata might need a slight modification. Currently, Parallax returns the JSON with the form dict(image= image_info) or dict(images= image_list) . So, you probably want to
try: resp.read( ))['images' ] eption( 'Received malformed json from Parallax')
return json.loads(
except KeyError:
raise ImageServiceExc
(The reason I return the json as dict(image= image_info) rather than just returning the image_info as a dict directly-- as would make sense-- is that, when we do support XML, we'll need a name for the root tag. By doing it this way, JSON and XML can be derived from the exact same dict-representa tion.)
A teensy correction:
186 + # TODO(jaypipes): return or raise HTTP error?
187 + return []
get_image_metadata should return None if image is not found/available.