kopia lustrzana https://github.com/halcy/Mastodon.py
add instance_extended_description
rodzic
adabd511fe
commit
e5c00a9229
|
@ -35,6 +35,8 @@ v2.0.0 (IN PROGRESS)
|
||||||
* Add automatic conversion of datetime objects to flake IDs for min/max/since_id fields where appropriate
|
* Add automatic conversion of datetime objects to flake IDs for min/max/since_id fields where appropriate
|
||||||
* Add `notifications_unread_count`
|
* Add `notifications_unread_count`
|
||||||
* Add media attachment editing
|
* Add media attachment editing
|
||||||
|
* Add email domain blocking support (`admin_email_domain_blocks`, `admin_email_domain_block`, `admin_email_domain_block_create`, `admin_email_domain_block_delete`)
|
||||||
|
* Add `instance_extended_description`
|
||||||
|
|
||||||
v1.8.1
|
v1.8.1
|
||||||
------
|
------
|
||||||
|
|
|
@ -17,7 +17,8 @@ current instance as well as data from the instance-wide profile directory.
|
||||||
.. automethod:: Mastodon.instance_health
|
.. automethod:: Mastodon.instance_health
|
||||||
.. automethod:: Mastodon.instance_nodeinfo
|
.. automethod:: Mastodon.instance_nodeinfo
|
||||||
.. automethod:: Mastodon.instance_rules
|
.. automethod:: Mastodon.instance_rules
|
||||||
|
.. automethod:: Mastodon.instance_extended_description
|
||||||
|
|
||||||
Profile directory
|
Profile directory
|
||||||
~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~
|
||||||
.. automethod:: Mastodon.directory
|
.. automethod:: Mastodon.directory
|
||||||
|
|
|
@ -4,7 +4,7 @@ from mastodon.utility import api_version
|
||||||
from mastodon.compat import urlparse
|
from mastodon.compat import urlparse
|
||||||
|
|
||||||
from mastodon.internals import Mastodon as Internals
|
from mastodon.internals import Mastodon as Internals
|
||||||
from mastodon.return_types import Instance, InstanceV2, NonPaginatableList, Activity, Nodeinfo, AttribAccessDict, Rule, Announcement, CustomEmoji, Account, IdType
|
from mastodon.return_types import Instance, InstanceV2, NonPaginatableList, Activity, Nodeinfo, AttribAccessDict, Rule, Announcement, CustomEmoji, Account, IdType, ExtendedDescription
|
||||||
|
|
||||||
from typing import Union, Optional
|
from typing import Union, Optional
|
||||||
|
|
||||||
|
@ -199,3 +199,10 @@ class Mastodon(Internals):
|
||||||
"""
|
"""
|
||||||
id = self.__unpack_id(id)
|
id = self.__unpack_id(id)
|
||||||
self.__api_request('DELETE', f'/api/v1/announcements/{id}/reactions/{reaction}')
|
self.__api_request('DELETE', f'/api/v1/announcements/{id}/reactions/{reaction}')
|
||||||
|
|
||||||
|
@api_version("4.0.0", "4.0.0")
|
||||||
|
def instance_extended_description(self) -> ExtendedDescription:
|
||||||
|
"""
|
||||||
|
Retrieve the instance's extended description.
|
||||||
|
"""
|
||||||
|
return self.__api_request('GET', '/api/v1/instance/extended_description', parse=False).decode("utf-8")
|
||||||
|
|
|
@ -8437,7 +8437,7 @@
|
||||||
{
|
{
|
||||||
"name": "Extended instance description",
|
"name": "Extended instance description",
|
||||||
"python_name": "ExtendedDescription",
|
"python_name": "ExtendedDescription",
|
||||||
"func_call": "TODO_TO_BE_IMPLEMENTED",
|
"func_call": "mastodon.instance_extended_description()",
|
||||||
"func_call_real": null,
|
"func_call_real": null,
|
||||||
"func_call_additional": null,
|
"func_call_additional": null,
|
||||||
"func_alternate_acc": null,
|
"func_alternate_acc": null,
|
||||||
|
@ -8670,7 +8670,7 @@
|
||||||
{
|
{
|
||||||
"name": "Status source",
|
"name": "Status source",
|
||||||
"python_name": "StatusSource",
|
"python_name": "StatusSource",
|
||||||
"func_call": "TODO_TO_BE_IMPLEMENTED",
|
"func_call": "mastodon.status_source()",
|
||||||
"func_call_real": null,
|
"func_call_real": null,
|
||||||
"func_call_additional": null,
|
"func_call_additional": null,
|
||||||
"func_alternate_acc": null,
|
"func_alternate_acc": null,
|
||||||
|
@ -9547,7 +9547,7 @@
|
||||||
{
|
{
|
||||||
"name": "Account Warning",
|
"name": "Account Warning",
|
||||||
"python_name": "AccountWarning",
|
"python_name": "AccountWarning",
|
||||||
"func_call": "# There isn't really a good way to get this manually - you get it if a moderation takes action.",
|
"func_call": "# There isn't really a good way to get this manually - you get it if a moderator takes action.",
|
||||||
"func_call_real": null,
|
"func_call_real": null,
|
||||||
"func_call_additional": null,
|
"func_call_additional": null,
|
||||||
"func_alternate_acc": null,
|
"func_alternate_acc": null,
|
||||||
|
@ -9661,11 +9661,11 @@
|
||||||
{
|
{
|
||||||
"name": "Appeal",
|
"name": "Appeal",
|
||||||
"python_name": "Appeal",
|
"python_name": "Appeal",
|
||||||
"func_call": "TODO_TO_BE_IMPLEMENTED",
|
"func_call": "# There isn't really a good way to get this manually - you get it if a moderator takes action.",
|
||||||
"func_call_real": null,
|
"func_call_real": null,
|
||||||
"func_call_additional": null,
|
"func_call_additional": null,
|
||||||
"func_alternate_acc": null,
|
"func_alternate_acc": null,
|
||||||
"manual_update": false,
|
"manual_update": true,
|
||||||
"masto_doc_link": "https://docs.joinmastodon.org/entities/Appeal/",
|
"masto_doc_link": "https://docs.joinmastodon.org/entities/Appeal/",
|
||||||
"description": "Appeal against a moderation action.",
|
"description": "Appeal against a moderation action.",
|
||||||
"fields": {
|
"fields": {
|
||||||
|
|
|
@ -0,0 +1,63 @@
|
||||||
|
interactions:
|
||||||
|
- request:
|
||||||
|
body: null
|
||||||
|
headers:
|
||||||
|
Accept:
|
||||||
|
- '*/*'
|
||||||
|
Accept-Encoding:
|
||||||
|
- gzip, deflate
|
||||||
|
Authorization:
|
||||||
|
- Bearer __MASTODON_PY_TEST_ACCESS_TOKEN
|
||||||
|
Connection:
|
||||||
|
- keep-alive
|
||||||
|
User-Agent:
|
||||||
|
- tests/v311
|
||||||
|
method: GET
|
||||||
|
uri: http://localhost:3000/api/v1/instance/extended_description
|
||||||
|
response:
|
||||||
|
body:
|
||||||
|
string: '{"updated_at":null,"content":""}'
|
||||||
|
headers:
|
||||||
|
Cache-Control:
|
||||||
|
- max-age=300, public, stale-while-revalidate=30, stale-if-error=86400
|
||||||
|
Content-Length:
|
||||||
|
- '32'
|
||||||
|
Content-Security-Policy:
|
||||||
|
- default-src 'none'; frame-ancestors 'none'; form-action 'none'
|
||||||
|
Content-Type:
|
||||||
|
- application/json; charset=utf-8
|
||||||
|
Date:
|
||||||
|
- Sat, 15 Feb 2025 15:11:19 GMT
|
||||||
|
ETag:
|
||||||
|
- W/"a7feb2b8d6c676e926cca06600860589"
|
||||||
|
Referrer-Policy:
|
||||||
|
- strict-origin-when-cross-origin
|
||||||
|
Server-Timing:
|
||||||
|
- cache_read.active_support;dur=0.07, sql.active_record;dur=2.98, cache_generate.active_support;dur=7.75,
|
||||||
|
cache_write.active_support;dur=0.17, instantiation.active_record;dur=0.23,
|
||||||
|
start_processing.action_controller;dur=0.01, render.active_model_serializers;dur=0.38,
|
||||||
|
process_action.action_controller;dur=23.00
|
||||||
|
X-Content-Type-Options:
|
||||||
|
- nosniff
|
||||||
|
X-Frame-Options:
|
||||||
|
- SAMEORIGIN
|
||||||
|
X-Permitted-Cross-Domain-Policies:
|
||||||
|
- none
|
||||||
|
X-RateLimit-Limit:
|
||||||
|
- '300'
|
||||||
|
X-RateLimit-Remaining:
|
||||||
|
- '299'
|
||||||
|
X-RateLimit-Reset:
|
||||||
|
- '2025-02-15T15:15:00.307003Z'
|
||||||
|
X-Request-Id:
|
||||||
|
- 5f2a511b-6332-44d1-b1c6-bc29882cb543
|
||||||
|
X-Runtime:
|
||||||
|
- '0.067181'
|
||||||
|
X-XSS-Protection:
|
||||||
|
- '0'
|
||||||
|
vary:
|
||||||
|
- Accept, Origin
|
||||||
|
status:
|
||||||
|
code: 200
|
||||||
|
message: OK
|
||||||
|
version: 1
|
|
@ -23,6 +23,10 @@ def test_instance(api):
|
||||||
expected_keys = set(('description', )) # TODO add some more maybe
|
expected_keys = set(('description', )) # TODO add some more maybe
|
||||||
assert set(instance.keys()) >= expected_keys
|
assert set(instance.keys()) >= expected_keys
|
||||||
|
|
||||||
|
@pytest.mark.vcr()
|
||||||
|
def test_instance_extended_description(api):
|
||||||
|
extended_desc = api.instance_extended_description()
|
||||||
|
assert extended_desc
|
||||||
|
|
||||||
@pytest.mark.vcr()
|
@pytest.mark.vcr()
|
||||||
def test_instance_activity(api):
|
def test_instance_activity(api):
|
||||||
|
|
Ładowanie…
Reference in New Issue