From 43ccb72275e7401167d30529c100d8454832c8fd Mon Sep 17 00:00:00 2001 From: halcy Date: Sun, 23 Apr 2023 18:44:47 +0300 Subject: [PATCH] Move user agent default to where it belongs --- CHANGELOG.rst | 6 ++++++ mastodon/authentication.py | 4 +--- mastodon/defaults.py | 1 + 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index f146ee5..e0320af 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -2,6 +2,12 @@ A note on versioning: This librarys major version will grow with the APIs version number. Breaking changes will be indicated by a change in the minor (or major) version number, and will generally be avoided. +v1.8.0 (in progress) +-------------------- +* Replace some lambdas with list comprenehsions (thanks eumiro) +* Add `resolve` keyword to `account_search` (thanks zevaryx) +* Add support for user agent header in `create_app` (thanks jkawamoto) + v1.8.0 ------ * Overall: Support level is now 3.5.5 (last before 4.0.0) diff --git a/mastodon/authentication.py b/mastodon/authentication.py index 4403770..6cb2aad 100644 --- a/mastodon/authentication.py +++ b/mastodon/authentication.py @@ -9,13 +9,11 @@ import collections from .errors import MastodonIllegalArgumentError, MastodonNetworkError, MastodonVersionError, MastodonAPIError from .versions import _DICT_VERSION_APPLICATION -from .defaults import _DEFAULT_SCOPES, _SCOPE_SETS, _DEFAULT_TIMEOUT +from .defaults import _DEFAULT_SCOPES, _SCOPE_SETS, _DEFAULT_TIMEOUT, _DEFAULT_USER_AGENT from .utility import parse_version_string, api_version from .internals import Mastodon as Internals -_DEFAULT_USER_AGENT = "mastodonpy" - class Mastodon(Internals): ### # Registering apps diff --git a/mastodon/defaults.py b/mastodon/defaults.py index 950ffa2..401b358 100644 --- a/mastodon/defaults.py +++ b/mastodon/defaults.py @@ -3,6 +3,7 @@ _DEFAULT_TIMEOUT = 300 _DEFAULT_STREAM_TIMEOUT = 300 _DEFAULT_STREAM_RECONNECT_WAIT_SEC = 5 +_DEFAULT_USER_AGENT = "mastodonpy" _DEFAULT_SCOPES = ['read', 'write', 'follow', 'push'] _SCOPE_SETS = { 'read': [