From 23e796bab4e19348d77a94cbcd27cd3539838cc5 Mon Sep 17 00:00:00 2001 From: Lorenz Diener Date: Wed, 26 Apr 2017 13:24:27 +0200 Subject: Fixed follows docs --- DEVELOPMENT.md | 1 - docs/index.rst | 4 ++-- mastodon/Mastodon.py | 18 +++++++++--------- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 4693afe..f5d1583 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -13,7 +13,6 @@ Here's some general stuff to keep in mind, and some work that needs to be done * Documentation that needs to be updated: * Toot dicts are missing some fields (cards, applications, visibility) * Some others probably are missing stuff also - * Follows is missclassified * Other things missing: * Transparent as well as explicit pagination support diff --git a/docs/index.rst b/docs/index.rst index bad52d2..166b51e 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -238,7 +238,6 @@ their relationships. .. automethod:: Mastodon.account_statuses .. automethod:: Mastodon.account_following .. automethod:: Mastodon.account_followers -.. automethod:: Mastodon.follows .. automethod:: Mastodon.account_relationships .. automethod:: Mastodon.account_search @@ -289,7 +288,8 @@ Writing data: Accounts These functions allow you to interact with other accounts: To (un)follow and (un)block. -.. automethod:: Mastodon.account_follow +.. automethod:: Mastodon.account_follow +.. automethod:: Mastodon.follows .. automethod:: Mastodon.account_unfollow .. automethod:: Mastodon.account_block .. automethod:: Mastodon.account_unblock diff --git a/mastodon/Mastodon.py b/mastodon/Mastodon.py index 4717674..68f9e56 100644 --- a/mastodon/Mastodon.py +++ b/mastodon/Mastodon.py @@ -364,15 +364,6 @@ class Mastodon: params = self.__generate_params(locals(), ['id']) return self.__api_request('GET', '/api/v1/accounts/' + str(id) + '/followers', params) - def follows(self, uri): - """ - Follow a remote user by uri (username@domain). - - Returns a user dict. - """ - params = self.__generate_params(locals()) - return self.__api_request('POST', '/api/v1/follows', params) - def account_relationships(self, id): """ Fetch relationships (following, followed_by, blocking) of the logged in user to @@ -571,6 +562,15 @@ class Mastodon: """ return self.__api_request('POST', '/api/v1/accounts/' + str(id) + "/follow") + def follows(self, uri): + """ + Follow a remote user by uri (username@domain). + + Returns a user dict. + """ + params = self.__generate_params(locals()) + return self.__api_request('POST', '/api/v1/follows', params) + def account_unfollow(self, id): """ Unfollow a user. -- cgit v1.2.3