diff options
author | Lorenz Diener <[email protected]> | 2022-12-02 23:55:32 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2022-12-02 23:55:32 +0200 |
commit | f5d4fbc1f0bd61e80f9daced15d7ef7ee349b50f (patch) | |
tree | 247b41199512db9693d00baf7522602805e31c3f /mastodon/filters.py | |
parent | c796cf39b01e38fe381fb4743988da991b072183 (diff) | |
parent | 325cc917d5ad14b130b156d23b7adca46499dc24 (diff) | |
download | mastodon.py-f5d4fbc1f0bd61e80f9daced15d7ef7ee349b50f.tar.gz |
Merge pull request #290 from eumiro/fstrings
refactor: use f-strings
Diffstat (limited to 'mastodon/filters.py')
-rw-r--r-- | mastodon/filters.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/mastodon/filters.py b/mastodon/filters.py index 5f373d4..8841ba8 100644 --- a/mastodon/filters.py +++ b/mastodon/filters.py | |||
@@ -29,8 +29,7 @@ class Mastodon(Internals): | |||
29 | Returns a :ref:`filter dict <filter dict>`. | 29 | Returns a :ref:`filter dict <filter dict>`. |
30 | """ | 30 | """ |
31 | id = self.__unpack_id(id) | 31 | id = self.__unpack_id(id) |
32 | url = '/api/v1/filters/{0}'.format(str(id)) | 32 | return self.__api_request('GET', f'/api/v1/filters/{id}') |
33 | return self.__api_request('GET', url) | ||
34 | 33 | ||
35 | @api_version("2.4.3", "2.4.3", _DICT_VERSION_FILTER) | 34 | @api_version("2.4.3", "2.4.3", _DICT_VERSION_FILTER) |
36 | def filters_apply(self, objects, filters, context): | 35 | def filters_apply(self, objects, filters, context): |
@@ -106,8 +105,7 @@ class Mastodon(Internals): | |||
106 | """ | 105 | """ |
107 | id = self.__unpack_id(id) | 106 | id = self.__unpack_id(id) |
108 | params = self.__generate_params(locals(), ['id']) | 107 | params = self.__generate_params(locals(), ['id']) |
109 | url = '/api/v1/filters/{0}'.format(str(id)) | 108 | return self.__api_request('PUT', f'/api/v1/filters/{id}', params) |
110 | return self.__api_request('PUT', url, params) | ||
111 | 109 | ||
112 | @api_version("2.4.3", "2.4.3", "2.4.3") | 110 | @api_version("2.4.3", "2.4.3", "2.4.3") |
113 | def filter_delete(self, id): | 111 | def filter_delete(self, id): |
@@ -115,5 +113,4 @@ class Mastodon(Internals): | |||
115 | Deletes the filter with the given `id`. | 113 | Deletes the filter with the given `id`. |
116 | """ | 114 | """ |
117 | id = self.__unpack_id(id) | 115 | id = self.__unpack_id(id) |
118 | url = '/api/v1/filters/{0}'.format(str(id)) | 116 | self.__api_request('DELETE', f'/api/v1/filters/{id}') |
119 | self.__api_request('DELETE', url) \ No newline at end of file | ||