diff options
author | Lorenz Diener <[email protected]> | 2018-04-17 17:49:08 +0200 |
---|---|---|
committer | Lorenz Diener <[email protected]> | 2018-04-17 17:49:08 +0200 |
commit | 5f44998dd201beb871f06c0813b3dc69d387f7da (patch) | |
tree | f1f87cc7d136986e44ce812c38522a61b3375828 | |
parent | 78d3b3a5dff7fb465a21fbade09e972e9d8f0fbf (diff) | |
download | mastodon.py-5f44998dd201beb871f06c0813b3dc69d387f7da.tar.gz |
First steps to 2.3.0 support
-rw-r--r-- | docs/index.rst | 17 | ||||
-rw-r--r-- | mastodon/Mastodon.py | 6 |
2 files changed, 19 insertions, 4 deletions
diff --git a/docs/index.rst b/docs/index.rst index eebe893..436d7cc 100644 --- a/docs/index.rst +++ b/docs/index.rst | |||
@@ -385,10 +385,13 @@ Media dicts | |||
385 | 'preview_url': # The URL for the media preview | 385 | 'preview_url': # The URL for the media preview |
386 | 'text_url': # The display text for the media (what shows up in toots) | 386 | 'text_url': # The display text for the media (what shows up in toots) |
387 | 'meta': # Dictionary of two image metadata dicts (see below), | 387 | 'meta': # Dictionary of two image metadata dicts (see below), |
388 | # 'original' and 'small' (preview) | 388 | # 'original' and 'small' (preview). Either may be empty. |
389 | # May additionally contain an "fps" field giving a videos frames per second (possibly | ||
390 | # rounded), and a "length" field giving a videos length in a human-readable format. | ||
391 | # Note that a video may have an image as preview. | ||
389 | } | 392 | } |
390 | 393 | ||
391 | # Metadata dicts: | 394 | # Metadata dicts (image) - all fields are optional: |
392 | { | 395 | { |
393 | 'width': # Width of the image in pixels | 396 | 'width': # Width of the image in pixels |
394 | 'height': # Height of the image in pixels | 397 | 'height': # Height of the image in pixels |
@@ -396,6 +399,14 @@ Media dicts | |||
396 | 'size': # Textual representation of the image size in pixels, e.g. '800x600' | 399 | 'size': # Textual representation of the image size in pixels, e.g. '800x600' |
397 | } | 400 | } |
398 | 401 | ||
402 | # Metadata dicts (video, gifv) - all fields are optional: | ||
403 | { | ||
404 | 'width': # Width of the video in pixels | ||
405 | 'heigh': # Height of the video in pixels | ||
406 | 'frame_rate': # Exact frame rate of the video in frames per second | ||
407 | 'duration': # Duration of the video in seconds | ||
408 | 'bitrate': # Average bit-rate of the video in bytes per second | ||
409 | } | ||
399 | Card dicts | 410 | Card dicts |
400 | ~~~~~~~~~~ | 411 | ~~~~~~~~~~ |
401 | .. _card dict: | 412 | .. _card dict: |
@@ -452,6 +463,8 @@ Instance dicts | |||
452 | 'version': # The instances mastodon version | 463 | 'version': # The instances mastodon version |
453 | 'urls': # Additional URLs dict, presently only 'streaming_api' with the | 464 | 'urls': # Additional URLs dict, presently only 'streaming_api' with the |
454 | # stream websocket address. | 465 | # stream websocket address. |
466 | 'contact_account': # Account dict of the primary contact for the instance. | ||
467 | 'languages': # Array of ISO 6391 language codes the instance has chosen to advertise. | ||
455 | } | 468 | } |
456 | 469 | ||
457 | Activity dicts | 470 | Activity dicts |
diff --git a/mastodon/Mastodon.py b/mastodon/Mastodon.py index 1056d7a..5a32be0 100644 --- a/mastodon/Mastodon.py +++ b/mastodon/Mastodon.py | |||
@@ -1143,9 +1143,9 @@ class Mastodon: | |||
1143 | url = '/api/v1/accounts/{0}/unmute'.format(str(id)) | 1143 | url = '/api/v1/accounts/{0}/unmute'.format(str(id)) |
1144 | return self.__api_request('POST', url) | 1144 | return self.__api_request('POST', url) |
1145 | 1145 | ||
1146 | @api_version("1.1.1", "2.1.0") | 1146 | @api_version("1.1.1", "2.3.0") |
1147 | def account_update_credentials(self, display_name=None, note=None, | 1147 | def account_update_credentials(self, display_name=None, note=None, |
1148 | avatar=None, header=None): | 1148 | avatar=None, header=None, locked=None): |
1149 | """ | 1149 | """ |
1150 | Update the profile for the currently logged-in user. | 1150 | Update the profile for the currently logged-in user. |
1151 | 1151 | ||
@@ -1154,6 +1154,8 @@ class Mastodon: | |||
1154 | 'avatar' and 'header' are images encoded in base64, prepended by a content-type | 1154 | 'avatar' and 'header' are images encoded in base64, prepended by a content-type |
1155 | (for example: 'data:image/png;base64,iVBORw0KGgoAAAA[...]') | 1155 | (for example: 'data:image/png;base64,iVBORw0KGgoAAAA[...]') |
1156 | 1156 | ||
1157 | 'locked' specifies whether the user needs to manually approve follow requests. | ||
1158 | |||
1157 | Returns the updated `user dict` of the logged-in user. | 1159 | Returns the updated `user dict` of the logged-in user. |
1158 | """ | 1160 | """ |
1159 | params = self.__generate_params(locals()) | 1161 | params = self.__generate_params(locals()) |