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/polls.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/polls.py')
-rw-r--r-- | mastodon/polls.py | 8 |
1 files changed, 3 insertions, 5 deletions
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): | |||
17 | Returns a :ref:`poll dict <poll dict>`. | 17 | Returns a :ref:`poll dict <poll dict>`. |
18 | """ | 18 | """ |
19 | id = self.__unpack_id(id) | 19 | id = self.__unpack_id(id) |
20 | url = '/api/v1/polls/{0}'.format(str(id)) | 20 | return self.__api_request('GET', f'/api/v1/polls/{id}') |
21 | return self.__api_request('GET', url) | ||
22 | 21 | ||
23 | ### | 22 | ### |
24 | # Writing data: Polls | 23 | # Writing data: Polls |
@@ -44,9 +43,8 @@ class Mastodon(Internals): | |||
44 | choices = [choices] | 43 | choices = [choices] |
45 | params = self.__generate_params(locals(), ['id']) | 44 | params = self.__generate_params(locals(), ['id']) |
46 | 45 | ||
47 | url = '/api/v1/polls/{0}/votes'.format(id) | 46 | self.__api_request('POST', f'/api/v1/polls/{id}/votes', params) |
48 | self.__api_request('POST', url, params) | 47 | |
49 | |||
50 | def make_poll(self, options, expires_in, multiple=False, hide_totals=False): | 48 | def make_poll(self, options, expires_in, multiple=False, hide_totals=False): |
51 | """ | 49 | """ |
52 | Generate a poll object that can be passed as the `poll` option when posting a status. | 50 | Generate a poll object that can be passed as the `poll` option when posting a status. |