diff options
-rw-r--r-- | docs/index.rst | 22 | ||||
-rw-r--r-- | mastodon/Mastodon.py | 12 |
2 files changed, 23 insertions, 11 deletions
diff --git a/docs/index.rst b/docs/index.rst index 9496da6..4dd6403 100644 --- a/docs/index.rst +++ b/docs/index.rst | |||
@@ -512,6 +512,14 @@ their relationships. | |||
512 | .. automethod:: Mastodon.account_relationships | 512 | .. automethod:: Mastodon.account_relationships |
513 | .. automethod:: Mastodon.account_search | 513 | .. automethod:: Mastodon.account_search |
514 | 514 | ||
515 | Reading data: Lists | ||
516 | ------------------- | ||
517 | These functions allow you to view information about lists. | ||
518 | |||
519 | .. automethod:: Mastodon.lists | ||
520 | .. automethod:: Mastodon.list | ||
521 | .. automethod:: Mastodon.list_accounts | ||
522 | |||
515 | Reading data: Follows | 523 | Reading data: Follows |
516 | --------------------- | 524 | --------------------- |
517 | 525 | ||
@@ -532,7 +540,6 @@ Reading data: Searching | |||
532 | 540 | ||
533 | .. automethod:: Mastodon.search | 541 | .. automethod:: Mastodon.search |
534 | 542 | ||
535 | |||
536 | Reading data: Mutes and blocks | 543 | Reading data: Mutes and blocks |
537 | ------------------------------ | 544 | ------------------------------ |
538 | These functions allow you to get information about accounts that are | 545 | These functions allow you to get information about accounts that are |
@@ -593,6 +600,19 @@ These functions allow you to interact with other accounts: To (un)follow and | |||
593 | .. automethod:: Mastodon.account_unmute | 600 | .. automethod:: Mastodon.account_unmute |
594 | .. automethod:: Mastodon.account_update_credentials | 601 | .. automethod:: Mastodon.account_update_credentials |
595 | 602 | ||
603 | Writing data: Lists | ||
604 | ------------------- | ||
605 | These functions allow you to create, maintain and delete lists. | ||
606 | |||
607 | When creating lists, note that (As of Mastodon 2.1.0), a user can only | ||
608 | have a maximum of 50 lists. | ||
609 | |||
610 | .. automethod:: Mastodon.list_create | ||
611 | .. automethod:: Mastodon.list_update | ||
612 | .. automethod:: Mastodon.list_delete | ||
613 | .. automethod:: Mastodon.list_accounts_add | ||
614 | .. automethod:: Mastodon.list_accounts_delete | ||
615 | |||
596 | Writing data: Follow requests | 616 | Writing data: Follow requests |
597 | ----------------------------- | 617 | ----------------------------- |
598 | These functions allow you to accept or reject incoming follow requests. | 618 | These functions allow you to accept or reject incoming follow requests. |
diff --git a/mastodon/Mastodon.py b/mastodon/Mastodon.py index 3b02881..f15ee23 100644 --- a/mastodon/Mastodon.py +++ b/mastodon/Mastodon.py | |||
@@ -1106,14 +1106,6 @@ class Mastodon: | |||
1106 | self.__api_request('DELETE', '/api/v1/lists/{0}'.format(id)) | 1106 | self.__api_request('DELETE', '/api/v1/lists/{0}'.format(id)) |
1107 | 1107 | ||
1108 | @api_version("2.1.0") | 1108 | @api_version("2.1.0") |
1109 | def list_delete(self, id): | ||
1110 | """ | ||
1111 | Delete a list. | ||
1112 | """ | ||
1113 | id = self.__unpack_id(id) | ||
1114 | self.__api_request('DELETE', '/api/v1/lists/{0}'.format(id)) | ||
1115 | |||
1116 | @api_version("2.1.0") | ||
1117 | def list_accounts_add(self, id, account_ids): | 1109 | def list_accounts_add(self, id, account_ids): |
1118 | """ | 1110 | """ |
1119 | Add the account(s) given in `account_ids` to the list. | 1111 | Add the account(s) given in `account_ids` to the list. |
@@ -1125,7 +1117,7 @@ class Mastodon: | |||
1125 | account_ids = list(map(lambda x: self.__unpack_id(x), account_ids)) | 1117 | account_ids = list(map(lambda x: self.__unpack_id(x), account_ids)) |
1126 | 1118 | ||
1127 | params = self.__generate_params(locals(), ['id']) | 1119 | params = self.__generate_params(locals(), ['id']) |
1128 | return self.__api_request('POST', '/api/v1/lists/{0}/accounts'.format(id), params) | 1120 | self.__api_request('POST', '/api/v1/lists/{0}/accounts'.format(id), params) |
1129 | 1121 | ||
1130 | @api_version("2.1.0") | 1122 | @api_version("2.1.0") |
1131 | def list_accounts_delete(self, id, account_ids): | 1123 | def list_accounts_delete(self, id, account_ids): |
@@ -1139,7 +1131,7 @@ class Mastodon: | |||
1139 | account_ids = list(map(lambda x: self.__unpack_id(x), account_ids)) | 1131 | account_ids = list(map(lambda x: self.__unpack_id(x), account_ids)) |
1140 | 1132 | ||
1141 | params = self.__generate_params(locals(), ['id']) | 1133 | params = self.__generate_params(locals(), ['id']) |
1142 | return self.__api_request('DELETE', '/api/v1/lists/{0}/accounts'.format(id), params) | 1134 | self.__api_request('DELETE', '/api/v1/lists/{0}/accounts'.format(id), params) |
1143 | 1135 | ||
1144 | ### | 1136 | ### |
1145 | # Writing data: Reports | 1137 | # Writing data: Reports |