Trailing whitespace removal
This commit is contained in:
parent
ba681cea89
commit
b2e7aa1f27
3 changed files with 26 additions and 26 deletions
|
@ -17,10 +17,10 @@ class OpenPhotoObject:
|
|||
if key.startswith("_"):
|
||||
raise ValueError("Illegal attribute: %s" % key)
|
||||
setattr(self, key, value)
|
||||
|
||||
|
||||
def _replace_fields(self, json_dict):
|
||||
"""
|
||||
Delete this object's attributes, and replace with
|
||||
"""
|
||||
Delete this object's attributes, and replace with
|
||||
those in json_dict.
|
||||
"""
|
||||
for key in self._json_dict.keys():
|
||||
|
@ -54,7 +54,7 @@ class Photo(OpenPhotoObject):
|
|||
|
||||
def edit(self, **kwds):
|
||||
""" Returns an HTML form to edit the photo """
|
||||
result = self._openphoto.get("/photo/%s/edit.json" % self.id,
|
||||
result = self._openphoto.get("/photo/%s/edit.json" % self.id,
|
||||
**kwds)["result"]
|
||||
return result["markup"]
|
||||
|
||||
|
@ -66,16 +66,16 @@ class Photo(OpenPhotoObject):
|
|||
|
||||
def update(self, **kwds):
|
||||
""" Update this photo with the specified parameters """
|
||||
new_dict = self._openphoto.post("/photo/%s/update.json" % self.id,
|
||||
new_dict = self._openphoto.post("/photo/%s/update.json" % self.id,
|
||||
**kwds)["result"]
|
||||
self._replace_fields(new_dict)
|
||||
|
||||
def view(self, **kwds):
|
||||
"""
|
||||
Used to view the photo at a particular size.
|
||||
"""
|
||||
Used to view the photo at a particular size.
|
||||
Updates the photo's fields with the response.
|
||||
"""
|
||||
new_dict = self._openphoto.get("/photo/%s/view.json" % self.id,
|
||||
new_dict = self._openphoto.get("/photo/%s/view.json" % self.id,
|
||||
**kwds)["result"]
|
||||
self._replace_fields(new_dict)
|
||||
|
||||
|
@ -83,11 +83,11 @@ class Photo(OpenPhotoObject):
|
|||
raise NotImplementedError()
|
||||
|
||||
def next_previous(self, **kwds):
|
||||
"""
|
||||
Returns a dict containing the next and previous photo lists
|
||||
(there may be more than one next/previous photo returned).
|
||||
"""
|
||||
result = self._openphoto.get("/photo/%s/nextprevious.json" % self.id,
|
||||
Returns a dict containing the next and previous photo lists
|
||||
(there may be more than one next/previous photo returned).
|
||||
"""
|
||||
result = self._openphoto.get("/photo/%s/nextprevious.json" % self.id,
|
||||
**kwds)["result"]
|
||||
value = {}
|
||||
if "next" in result:
|
||||
|
@ -137,7 +137,7 @@ class Tag(OpenPhotoObject):
|
|||
|
||||
def update(self, **kwds):
|
||||
""" Update this tag with the specified parameters """
|
||||
new_dict = self._openphoto.post("/tag/%s/update.json" % quote(self.id),
|
||||
new_dict = self._openphoto.post("/tag/%s/update.json" % quote(self.id),
|
||||
**kwds)["result"]
|
||||
self._replace_fields(new_dict)
|
||||
|
||||
|
@ -173,13 +173,13 @@ class Album(OpenPhotoObject):
|
|||
|
||||
def add_photos(self, **kwds):
|
||||
raise NotImplementedError()
|
||||
|
||||
|
||||
def remove_photos(self, **kwds):
|
||||
raise NotImplementedError()
|
||||
|
||||
def update(self, **kwds):
|
||||
""" Update this album with the specified parameters """
|
||||
new_dict = self._openphoto.post("/album/%s/update.json" % self.id,
|
||||
new_dict = self._openphoto.post("/album/%s/update.json" % self.id,
|
||||
**kwds)["result"]
|
||||
|
||||
# APIv1 doesn't return the updated album (frontend issue #937)
|
||||
|
@ -188,13 +188,13 @@ class Album(OpenPhotoObject):
|
|||
|
||||
self._replace_fields(new_dict)
|
||||
self._update_fields_with_objects()
|
||||
|
||||
|
||||
def view(self, **kwds):
|
||||
"""
|
||||
"""
|
||||
Requests the full contents of the album.
|
||||
Updates the album's fields with the response.
|
||||
"""
|
||||
result = self._openphoto.get("/album/%s/view.json" % self.id,
|
||||
result = self._openphoto.get("/album/%s/view.json" % self.id,
|
||||
**kwds)["result"]
|
||||
self._replace_fields(result)
|
||||
self._update_fields_with_objects()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue