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/polls.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'mastodon/polls.py') diff --git a/mastodon/polls.py b/mastodon/polls.py index d974531..2722ba8 100644 --- a/mastodon/polls.py +++ b/mastodon/polls.py @@ -17,8 +17,7 @@ class Mastodon(Internals): Returns a :ref:`poll dict `. """ id = self.__unpack_id(id) - url = '/api/v1/polls/{0}'.format(str(id)) - return self.__api_request('GET', url) + return self.__api_request('GET', f'/api/v1/polls/{id}') ### # Writing data: Polls @@ -44,9 +43,8 @@ class Mastodon(Internals): choices = [choices] params = self.__generate_params(locals(), ['id']) - url = '/api/v1/polls/{0}/votes'.format(id) - self.__api_request('POST', url, params) - + self.__api_request('POST', f'/api/v1/polls/{id}/votes', params) + def make_poll(self, options, expires_in, multiple=False, hide_totals=False): """ Generate a poll object that can be passed as the `poll` option when posting a status. -- cgit v1.2.3