More doc fixes, instance dictionaries

This commit is contained in:
Lorenz Diener 2017-06-15 22:48:23 +02:00
pare d5bb2418a9
commit b57b66ebb5
S'han modificat 2 arxius amb 33 adicions i 22 eliminacions

Veure arxiu

@ -228,6 +228,20 @@ Card dicts
'provider_url': # URL pointing to the embeds provider '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 App registration and user authentication
---------------------------------------- ----------------------------------------
Before you can use the mastodon API, you have to register your 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.log_in
.. automethod:: Mastodon.auth_request_url .. automethod:: Mastodon.auth_request_url
Reading data: Instance Reading data: Instances
----------------------- -----------------------
This function allows you to fetch information associated with the This function allows you to fetch information associated with the
current instance. current instance.
@ -300,9 +314,18 @@ Reading data: Follows
.. automethod:: Mastodon.follows .. automethod:: Mastodon.follows
Reading data: Favourites
------------------------
.. automethod:: Mastodon.favourites
Reading data: Follow requests
-----------------------------
.. automethod:: Mastodon.follow_requests
Reading data: Searching Reading data: Searching
----------------------- -----------------------
This function allows you to search for content.
.. automethod:: Mastodon.search .. automethod:: Mastodon.search
@ -317,25 +340,8 @@ muted or blocked by the logged in user.
Reading data: Reports 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.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 Writing data: Statuses
---------------------- ----------------------
@ -379,6 +385,11 @@ to attach media to statuses.
.. automethod:: Mastodon.media_post .. automethod:: Mastodon.media_post
Writing data: Reports
---------------------
.. automethod:: Mastodon.report
Streaming Streaming
--------- ---------
These functions allow access to the streaming API. These functions allow access to the streaming API.

Veure arxiu

@ -207,13 +207,13 @@ class Mastodon:
return response['access_token'] return response['access_token']
### ###
# Reading data: Instance # Reading data: Instances
### ###
def instance(self): def instance(self):
""" """
Retrieve basic information about the instance, including the URI and administrative contact email. 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/') return self.__api_request('GET', '/api/v1/instance/')
@ -656,7 +656,7 @@ class Mastodon:
### ###
def report(self, account_id, status_ids, comment): 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. Accepts a list of toot IDs associated with the report, and a comment.