Docstring updates
This commit is contained in:
parent
8c8c0e6bd5
commit
3e4fdf6dd6
6 changed files with 62 additions and 16 deletions
|
@ -9,7 +9,13 @@ from .api_base import ApiBase
|
|||
class ApiActivities(ApiBase):
|
||||
""" Definitions of /activities/ API endpoints """
|
||||
def list(self, filters={}, **kwds):
|
||||
""" Returns a list of Activity objects """
|
||||
"""
|
||||
Endpoint: /activities/[<filters>]/list.json
|
||||
|
||||
Returns a list of Activity objects.
|
||||
The filters parameter can be used to narrow down the returned activities.
|
||||
Eg: filters={"type": "photo-upload"}
|
||||
"""
|
||||
filter_string = self._build_filter_string(filters)
|
||||
activities = self._client.get("/activities/%slist.json" % filter_string,
|
||||
**kwds)["result"]
|
||||
|
@ -17,7 +23,12 @@ class ApiActivities(ApiBase):
|
|||
return [Activity(self._client, activity) for activity in activities]
|
||||
|
||||
def purge(self, **kwds):
|
||||
""" Purge all activities """
|
||||
"""
|
||||
Endpoint: /activities/purge.json
|
||||
|
||||
Purges all activities.
|
||||
Currently not working due to frontend issue #1368
|
||||
"""
|
||||
if not self._client.post("/activities/purge.json", **kwds)["result"]:
|
||||
raise TroveboxError("Purge response returned False")
|
||||
return True
|
||||
|
@ -26,7 +37,9 @@ class ApiActivity(ApiBase):
|
|||
""" Definitions of /activity/ API endpoints """
|
||||
def view(self, activity, **kwds):
|
||||
"""
|
||||
View an activity's contents.
|
||||
Endpoint: /activity/<id>/view.json
|
||||
|
||||
Requests all properties of an activity.
|
||||
Returns the requested activity object.
|
||||
"""
|
||||
if not isinstance(activity, Activity):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue