kopia lustrzana https://github.com/halcy/Mastodon.py
clean up versions.py
rodzic
1e1bc0cf78
commit
a1fe0289a2
|
@ -28,15 +28,6 @@ from mastodon.utility import Mastodon as MastoUtility
|
|||
from mastodon.return_types import *
|
||||
from mastodon.errors import *
|
||||
|
||||
from mastodon.versions import _DICT_VERSION_APPLICATION, _DICT_VERSION_MENTION, _DICT_VERSION_MEDIA, _DICT_VERSION_ACCOUNT, _DICT_VERSION_POLL, \
|
||||
_DICT_VERSION_STATUS, _DICT_VERSION_INSTANCE, _DICT_VERSION_HASHTAG, _DICT_VERSION_EMOJI, _DICT_VERSION_RELATIONSHIP, \
|
||||
_DICT_VERSION_NOTIFICATION, _DICT_VERSION_CONTEXT, _DICT_VERSION_LIST, _DICT_VERSION_CARD, _DICT_VERSION_SEARCHRESULT, \
|
||||
_DICT_VERSION_ACTIVITY, _DICT_VERSION_REPORT, _DICT_VERSION_PUSH, _DICT_VERSION_PUSH_NOTIF, _DICT_VERSION_FILTER, \
|
||||
_DICT_VERSION_CONVERSATION, _DICT_VERSION_SCHEDULED_STATUS, _DICT_VERSION_PREFERENCES, _DICT_VERSION_ADMIN_ACCOUNT, \
|
||||
_DICT_VERSION_FEATURED_TAG, _DICT_VERSION_MARKER, _DICT_VERSION_REACTION, _DICT_VERSION_ANNOUNCEMENT, _DICT_VERSION_STATUS_EDIT, \
|
||||
_DICT_VERSION_FAMILIAR_FOLLOWERS, _DICT_VERSION_ADMIN_DOMAIN_BLOCK, _DICT_VERSION_ADMIN_MEASURE, _DICT_VERSION_ADMIN_DIMENSION, \
|
||||
_DICT_VERSION_ADMIN_RETENTION
|
||||
|
||||
from mastodon.defaults import _DEFAULT_TIMEOUT, _DEFAULT_SCOPES, _DEFAULT_STREAM_TIMEOUT, _DEFAULT_STREAM_RECONNECT_WAIT_SEC
|
||||
from mastodon.defaults import _SCOPE_SETS
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
import collections
|
||||
|
||||
from mastodon.versions import _DICT_VERSION_ACCOUNT, _DICT_VERSION_STATUS, _DICT_VERSION_RELATIONSHIP, _DICT_VERSION_LIST, _DICT_VERSION_FAMILIAR_FOLLOWERS, _DICT_VERSION_HASHTAG
|
||||
from mastodon.defaults import _DEFAULT_SCOPES, _SCOPE_SETS
|
||||
from mastodon.errors import MastodonIllegalArgumentError, MastodonAPIError, MastodonNotFoundError
|
||||
from mastodon.utility import api_version
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
# admin.py - admin / moderation endpoints
|
||||
|
||||
from mastodon.versions import _DICT_VERSION_ADMIN_ACCOUNT, _DICT_VERSION_REPORT, _DICT_VERSION_HASHTAG, _DICT_VERSION_STATUS, _DICT_VERSION_CARD, \
|
||||
_DICT_VERSION_ADMIN_DOMAIN_BLOCK, _DICT_VERSION_ADMIN_MEASURE, _DICT_VERSION_ADMIN_DIMENSION, _DICT_VERSION_ADMIN_RETENTION
|
||||
from mastodon.errors import MastodonIllegalArgumentError
|
||||
from mastodon.utility import api_version
|
||||
|
||||
|
|
|
@ -8,7 +8,6 @@ import time
|
|||
import collections
|
||||
|
||||
from mastodon.errors import MastodonIllegalArgumentError, MastodonNetworkError, MastodonVersionError, MastodonAPIError
|
||||
from mastodon.versions import _DICT_VERSION_APPLICATION
|
||||
from mastodon.defaults import _DEFAULT_SCOPES, _SCOPE_SETS, _DEFAULT_TIMEOUT, _DEFAULT_USER_AGENT
|
||||
from mastodon.utility import parse_version_string, api_version
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
# conversations.py - conversation endpoints
|
||||
|
||||
from mastodon.versions import _DICT_VERSION_CONVERSATION
|
||||
from mastodon.utility import api_version
|
||||
|
||||
from mastodon.internals import Mastodon as Internals
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
# notifications.py - endorsement endpoints
|
||||
|
||||
from mastodon.versions import _DICT_VERSION_ACCOUNT
|
||||
from mastodon.utility import api_version
|
||||
|
||||
from mastodon.internals import Mastodon as Internals
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
# favourites.py - favourites and also bookmarks
|
||||
|
||||
from mastodon.versions import _DICT_VERSION_STATUS
|
||||
from mastodon.utility import api_version
|
||||
|
||||
from mastodon.internals import Mastodon as Internals
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
import re
|
||||
|
||||
from mastodon.versions import _DICT_VERSION_FILTER
|
||||
from mastodon.errors import MastodonIllegalArgumentError
|
||||
from mastodon.utility import api_version
|
||||
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
# hashtags.py - hashtag and featured-hashtag endpoints
|
||||
|
||||
from mastodon.versions import _DICT_VERSION_FEATURED_TAG, _DICT_VERSION_HASHTAG
|
||||
from mastodon.utility import api_version
|
||||
|
||||
from mastodon.internals import Mastodon as Internals
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
# instance.py - instance-level endpoints, directory, emoji, announcements
|
||||
|
||||
from mastodon.versions import _DICT_VERSION_INSTANCE, _DICT_VERSION_ACTIVITY, _DICT_VERSION_ACCOUNT, _DICT_VERSION_EMOJI, _DICT_VERSION_ANNOUNCEMENT
|
||||
from mastodon.errors import MastodonIllegalArgumentError, MastodonNotFoundError
|
||||
from mastodon.utility import api_version
|
||||
from mastodon.compat import urlparse
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
# list.py - list endpoints
|
||||
|
||||
from mastodon.versions import _DICT_VERSION_LIST, _DICT_VERSION_ACCOUNT
|
||||
from mastodon.utility import api_version
|
||||
|
||||
from mastodon.internals import Mastodon as Internals
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
import time
|
||||
|
||||
from mastodon.versions import _DICT_VERSION_MEDIA
|
||||
from mastodon.errors import MastodonVersionError, MastodonAPIError
|
||||
from mastodon.utility import api_version
|
||||
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
# notifications.py - notification endpoints
|
||||
|
||||
from mastodon.versions import _DICT_VERSION_NOTIFICATION
|
||||
from mastodon.errors import MastodonIllegalArgumentError
|
||||
from mastodon.utility import api_version
|
||||
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
# polls.py - poll related endpoints and tooling
|
||||
|
||||
from mastodon.versions import _DICT_VERSION_POLL
|
||||
from mastodon.utility import api_version
|
||||
|
||||
from mastodon.internals import Mastodon as Internals
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
import collections
|
||||
|
||||
from mastodon.versions import _DICT_VERSION_PREFERENCES, _DICT_VERSION_MARKER
|
||||
from mastodon.errors import MastodonIllegalArgumentError
|
||||
from mastodon.utility import api_version
|
||||
|
||||
|
|
|
@ -4,7 +4,6 @@ import base64
|
|||
import os
|
||||
import json
|
||||
|
||||
from mastodon.versions import _DICT_VERSION_PUSH, _DICT_VERSION_PUSH_NOTIF
|
||||
from mastodon.errors import MastodonIllegalArgumentError
|
||||
from mastodon.utility import api_version
|
||||
from mastodon.compat import IMPL_HAS_CRYPTO, ec, serialization, default_backend
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
# relationships.py - endpoints for user and domain blocks and mutes as well as follow requests
|
||||
|
||||
from mastodon.versions import _DICT_VERSION_ACCOUNT, _DICT_VERSION_RELATIONSHIP
|
||||
from mastodon.utility import api_version
|
||||
|
||||
from mastodon.internals import Mastodon as Internals
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
|
||||
# reports.py - report endpoints
|
||||
|
||||
from mastodon.versions import _DICT_VERSION_REPORT
|
||||
from mastodon.errors import MastodonVersionError, MastodonIllegalArgumentError
|
||||
from mastodon.utility import api_version
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
# search.py - search endpoints
|
||||
|
||||
from mastodon.versions import _DICT_VERSION_SEARCHRESULT
|
||||
from mastodon.errors import MastodonVersionError
|
||||
from mastodon.utility import api_version
|
||||
|
||||
|
|
|
@ -3,8 +3,6 @@
|
|||
import collections
|
||||
from datetime import datetime
|
||||
|
||||
from mastodon.versions import _DICT_VERSION_STATUS, _DICT_VERSION_CARD, _DICT_VERSION_CONTEXT, _DICT_VERSION_ACCOUNT, _DICT_VERSION_SCHEDULED_STATUS, \
|
||||
_DICT_VERSION_STATUS_EDIT
|
||||
from mastodon.errors import MastodonIllegalArgumentError
|
||||
from mastodon.utility import api_version
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
# relationships.py - endpoints for user and domain blocks and mutes as well as follow requests
|
||||
|
||||
from mastodon.versions import _DICT_VERSION_STATUS
|
||||
from mastodon.errors import MastodonIllegalArgumentError
|
||||
from mastodon.defaults import _DEFAULT_STREAM_TIMEOUT, _DEFAULT_STREAM_RECONNECT_WAIT_SEC
|
||||
from mastodon.utility import api_version
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
# suggestions.py - follow suggestion endpoints
|
||||
|
||||
from mastodon.versions import _DICT_VERSION_ACCOUNT
|
||||
from mastodon.utility import api_version
|
||||
|
||||
from mastodon.internals import Mastodon as Internals
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
# timeline.py - endpoints for reading various different timelines
|
||||
|
||||
from mastodon.versions import _DICT_VERSION_STATUS, _DICT_VERSION_CONVERSATION
|
||||
from mastodon.errors import MastodonIllegalArgumentError, MastodonNotFoundError
|
||||
from mastodon.utility import api_version
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
# trends.py - trend-related endpoints
|
||||
|
||||
from mastodon.versions import _DICT_VERSION_HASHTAG, _DICT_VERSION_STATUS, _DICT_VERSION_CARD
|
||||
from mastodon.utility import api_version
|
||||
|
||||
from mastodon.internals import Mastodon as Internals
|
||||
|
|
|
@ -55,44 +55,3 @@ def api_version(created_ver, last_changed_ver):
|
|||
function.__doc__ += f"\n\n *Added: Mastodon v{created_ver}, last changed: Mastodon v{last_changed_ver}*"
|
||||
return decorate(function, wrapper)
|
||||
return api_min_version_decorator
|
||||
|
||||
|
||||
###
|
||||
# Dict versions
|
||||
# TODO: Get rid of these
|
||||
###
|
||||
_DICT_VERSION_APPLICATION = "2.7.2"
|
||||
_DICT_VERSION_MENTION = "1.0.0"
|
||||
_DICT_VERSION_MEDIA = "3.2.0"
|
||||
_DICT_VERSION_ACCOUNT = "3.3.0"
|
||||
_DICT_VERSION_POLL = "2.8.0"
|
||||
_DICT_VERSION_STATUS = max_version("3.1.0", _DICT_VERSION_MEDIA, _DICT_VERSION_ACCOUNT, _DICT_VERSION_APPLICATION, _DICT_VERSION_MENTION, _DICT_VERSION_POLL)
|
||||
_DICT_VERSION_INSTANCE = max_version("3.4.0", _DICT_VERSION_ACCOUNT)
|
||||
_DICT_VERSION_HASHTAG = "2.3.4"
|
||||
_DICT_VERSION_EMOJI = "3.0.0"
|
||||
_DICT_VERSION_RELATIONSHIP = "3.3.0"
|
||||
_DICT_VERSION_NOTIFICATION = max_version("3.5.0", _DICT_VERSION_ACCOUNT, _DICT_VERSION_STATUS)
|
||||
_DICT_VERSION_CONTEXT = max_version("1.0.0", _DICT_VERSION_STATUS)
|
||||
_DICT_VERSION_LIST = "2.1.0"
|
||||
_DICT_VERSION_CARD = "3.2.0"
|
||||
_DICT_VERSION_SEARCHRESULT = max_version("1.0.0", _DICT_VERSION_ACCOUNT, _DICT_VERSION_STATUS, _DICT_VERSION_HASHTAG)
|
||||
_DICT_VERSION_ACTIVITY = "2.1.2"
|
||||
_DICT_VERSION_REPORT = "2.9.1"
|
||||
_DICT_VERSION_PUSH = "2.4.0"
|
||||
_DICT_VERSION_PUSH_NOTIF = "2.4.0"
|
||||
_DICT_VERSION_FILTER = "2.4.3"
|
||||
_DICT_VERSION_CONVERSATION = max_version("2.6.0", _DICT_VERSION_ACCOUNT, _DICT_VERSION_STATUS)
|
||||
_DICT_VERSION_SCHEDULED_STATUS = max_version("2.7.0", _DICT_VERSION_STATUS)
|
||||
_DICT_VERSION_PREFERENCES = "2.8.0"
|
||||
_DICT_VERSION_ADMIN_ACCOUNT = max_version("4.0.0", _DICT_VERSION_ACCOUNT)
|
||||
_DICT_VERSION_FEATURED_TAG = "3.0.0"
|
||||
_DICT_VERSION_MARKER = "3.0.0"
|
||||
_DICT_VERSION_REACTION = "3.1.0"
|
||||
_DICT_VERSION_ANNOUNCEMENT = max_version("3.1.0", _DICT_VERSION_REACTION)
|
||||
_DICT_VERSION_STATUS_EDIT = "3.5.0"
|
||||
_DICT_VERSION_FAMILIAR_FOLLOWERS = max_version("3.5.0", _DICT_VERSION_ACCOUNT)
|
||||
_DICT_VERSION_ADMIN_DOMAIN_BLOCK = "4.0.0"
|
||||
_DICT_VERSION_ADMIN_MEASURE = "3.5.0"
|
||||
_DICT_VERSION_ADMIN_DIMENSION = "3.5.0"
|
||||
_DICT_VERSION_ADMIN_RETENTION = "3.5.0"
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue