Add photo.transform support and testcase.

This commit is contained in:
sneakypete81 2012-09-10 23:57:42 +01:00
parent b900b2abd3
commit 4147029b14
3 changed files with 38 additions and 6 deletions

View file

@ -85,8 +85,15 @@ class Photo(OpenPhotoObject):
return value
def transform(self, **kwds):
raise NotImplementedError()
"""
Performs transformation specified in **kwds
Example: transform(rotate=90)
"""
new_dict = self._openphoto.post("/photo/%s/transform.json" % self.id,
**kwds)["result"]
# The API doesn't currently return the transformed photo
# Uncomment the below once frontend issue #955 is resolved
# self._replace_fields(new_dict)
class Tag(OpenPhotoObject):
def delete(self, **kwds):