From 325cc917d5ad14b130b156d23b7adca46499dc24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20=C5=A0ediv=C3=BD?= <6774676+eumiro@users.noreply.github.com> Date: Fri, 2 Dec 2022 22:04:23 +0100 Subject: refactor: use f-strings --- mastodon/filters.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'mastodon/filters.py') 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): Returns a :ref:`filter dict `. """ id = self.__unpack_id(id) - url = '/api/v1/filters/{0}'.format(str(id)) - return self.__api_request('GET', url) + return self.__api_request('GET', f'/api/v1/filters/{id}') @api_version("2.4.3", "2.4.3", _DICT_VERSION_FILTER) def filters_apply(self, objects, filters, context): @@ -106,8 +105,7 @@ class Mastodon(Internals): """ id = self.__unpack_id(id) params = self.__generate_params(locals(), ['id']) - url = '/api/v1/filters/{0}'.format(str(id)) - return self.__api_request('PUT', url, params) + return self.__api_request('PUT', f'/api/v1/filters/{id}', params) @api_version("2.4.3", "2.4.3", "2.4.3") def filter_delete(self, id): @@ -115,5 +113,4 @@ class Mastodon(Internals): Deletes the filter with the given `id`. """ id = self.__unpack_id(id) - url = '/api/v1/filters/{0}'.format(str(id)) - self.__api_request('DELETE', url) \ No newline at end of file + self.__api_request('DELETE', f'/api/v1/filters/{id}') -- cgit v1.2.3