From b57b66ebb5dc83b2b1f7c8624d31e605eb6e6c43 Mon Sep 17 00:00:00 2001 From: Lorenz Diener Date: Thu, 15 Jun 2017 22:48:23 +0200 Subject: [PATCH] More doc fixes, instance dictionaries --- docs/index.rst | 49 +++++++++++++++++++++++++++----------------- mastodon/Mastodon.py | 6 +++--- 2 files changed, 33 insertions(+), 22 deletions(-) diff --git a/docs/index.rst b/docs/index.rst index 8766dd8..90cc8e2 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -228,6 +228,20 @@ Card dicts 'provider_url': # URL pointing to the embeds provider } +Instance dicts +~~~~~~~~~~~~~~ +.. code-block:: python + + mastodon.instance() + # Returns the folowing dictionary + { + 'description': # A brief instance description set by the admin + 'email': # The admin contact e-mail + 'title': # The instances title + 'uri': # The instances URL + 'version': # The instances mastodon version + } + App registration and user authentication ---------------------------------------- Before you can use the mastodon API, you have to register your @@ -248,7 +262,7 @@ methods for this are provided. .. automethod:: Mastodon.log_in .. automethod:: Mastodon.auth_request_url -Reading data: Instance +Reading data: Instances ----------------------- This function allows you to fetch information associated with the current instance. @@ -300,9 +314,18 @@ Reading data: Follows .. automethod:: Mastodon.follows +Reading data: Favourites +------------------------ + +.. automethod:: Mastodon.favourites + +Reading data: Follow requests +----------------------------- + +.. automethod:: Mastodon.follow_requests + Reading data: Searching ----------------------- -This function allows you to search for content. .. automethod:: Mastodon.search @@ -317,25 +340,8 @@ muted or blocked by the logged in user. Reading data: Reports ------------------------------ -These functions allow you to retrieve information about reports filed -by the authenticated user, and file a report against a user. .. automethod:: Mastodon.reports -.. automethod:: Mastodon.report - -Reading data: Favourites ------------------------- -This function allows you to get information about statuses favourited -by the authenticated user. - -.. automethod:: Mastodon.favourites - -Reading data: Follow requests ------------------------------ -This function allows you to get a list of pending incoming follow -requests for the authenticated user. - -.. automethod:: Mastodon.follow_requests Writing data: Statuses ---------------------- @@ -379,6 +385,11 @@ to attach media to statuses. .. automethod:: Mastodon.media_post +Writing data: Reports +--------------------- + +.. automethod:: Mastodon.report + Streaming --------- These functions allow access to the streaming API. diff --git a/mastodon/Mastodon.py b/mastodon/Mastodon.py index b57a16b..3cf889a 100644 --- a/mastodon/Mastodon.py +++ b/mastodon/Mastodon.py @@ -207,13 +207,13 @@ class Mastodon: return response['access_token'] ### - # Reading data: Instance + # Reading data: Instances ### def instance(self): """ Retrieve basic information about the instance, including the URI and administrative contact email. - Returns a dict. + Returns an instance dict. """ return self.__api_request('GET', '/api/v1/instance/') @@ -656,7 +656,7 @@ class Mastodon: ### def report(self, account_id, status_ids, comment): """ - Report a user to the admin. + Report statuses to the instances administrators. Accepts a list of toot IDs associated with the report, and a comment.