@@ -1372,13 +1372,19 @@ def files_download_zip_to_file(self,
1372
1372
return r [0 ]
1373
1373
1374
1374
def files_export (self ,
1375
- path ):
1375
+ path ,
1376
+ export_format = None ):
1376
1377
"""
1377
1378
Export a file from a user's Dropbox. This route only supports exporting
1378
1379
files that cannot be downloaded directly and whose
1379
1380
``ExportResult.file_metadata`` has ``ExportInfo.export_as`` populated.
1380
1381
1381
1382
:param str path: The path of the file to be exported.
1383
+ :param Nullable[str] export_format: The file format to which the file
1384
+ should be exported. This must be one of the formats listed in the
1385
+ file's export_options returned by :meth:`files_get_metadata`. If
1386
+ none is specified, the default format (specified in export_as in
1387
+ file metadata) will be used.
1382
1388
:rtype: (:class:`dropbox.files.ExportResult`,
1383
1389
:class:`requests.models.Response`)
1384
1390
:raises: :class:`.exceptions.ApiError`
@@ -1392,7 +1398,8 @@ def files_export(self,
1392
1398
<https://docs.python.org/2/library/contextlib.html#contextlib.closing>`_
1393
1399
context manager to ensure this.
1394
1400
"""
1395
- arg = files .ExportArg (path )
1401
+ arg = files .ExportArg (path ,
1402
+ export_format )
1396
1403
r = self .request (
1397
1404
files .export ,
1398
1405
'files' ,
@@ -1403,21 +1410,28 @@ def files_export(self,
1403
1410
1404
1411
def files_export_to_file (self ,
1405
1412
download_path ,
1406
- path ):
1413
+ path ,
1414
+ export_format = None ):
1407
1415
"""
1408
1416
Export a file from a user's Dropbox. This route only supports exporting
1409
1417
files that cannot be downloaded directly and whose
1410
1418
``ExportResult.file_metadata`` has ``ExportInfo.export_as`` populated.
1411
1419
1412
1420
:param str download_path: Path on local machine to save file.
1413
1421
:param str path: The path of the file to be exported.
1422
+ :param Nullable[str] export_format: The file format to which the file
1423
+ should be exported. This must be one of the formats listed in the
1424
+ file's export_options returned by :meth:`files_get_metadata`. If
1425
+ none is specified, the default format (specified in export_as in
1426
+ file metadata) will be used.
1414
1427
:rtype: :class:`dropbox.files.ExportResult`
1415
1428
:raises: :class:`.exceptions.ApiError`
1416
1429
1417
1430
If this raises, ApiError will contain:
1418
1431
:class:`dropbox.files.ExportError`
1419
1432
"""
1420
- arg = files .ExportArg (path )
1433
+ arg = files .ExportArg (path ,
1434
+ export_format )
1421
1435
r = self .request (
1422
1436
files .export ,
1423
1437
'files' ,
@@ -1647,9 +1661,9 @@ def files_get_thumbnail(self,
1647
1661
mode = files .ThumbnailMode .strict ):
1648
1662
"""
1649
1663
Get a thumbnail for an image. This method currently supports files with
1650
- the following file extensions: jpg, jpeg, png, tiff, tif, gif and bmp.
1651
- Photos that are larger than 20MB in size won't be converted to a
1652
- thumbnail.
1664
+ the following file extensions: jpg, jpeg, png, tiff, tif, gif, webp, ppm
1665
+ and bmp. Photos that are larger than 20MB in size won't be converted to
1666
+ a thumbnail.
1653
1667
1654
1668
:param str path: The path to the image file you want to thumbnail.
1655
1669
:param format: The format for the thumbnail image, jpeg (default) or
@@ -1694,9 +1708,9 @@ def files_get_thumbnail_to_file(self,
1694
1708
mode = files .ThumbnailMode .strict ):
1695
1709
"""
1696
1710
Get a thumbnail for an image. This method currently supports files with
1697
- the following file extensions: jpg, jpeg, png, tiff, tif, gif and bmp.
1698
- Photos that are larger than 20MB in size won't be converted to a
1699
- thumbnail.
1711
+ the following file extensions: jpg, jpeg, png, tiff, tif, gif, webp, ppm
1712
+ and bmp. Photos that are larger than 20MB in size won't be converted to
1713
+ a thumbnail.
1700
1714
1701
1715
:param str download_path: Path on local machine to save file.
1702
1716
:param str path: The path to the image file you want to thumbnail.
@@ -1734,7 +1748,10 @@ def files_get_thumbnail_v2(self,
1734
1748
size = files .ThumbnailSize .w64h64 ,
1735
1749
mode = files .ThumbnailMode .strict ):
1736
1750
"""
1737
- Get a thumbnail for a file.
1751
+ Get a thumbnail for an image. This method currently supports files with
1752
+ the following file extensions: jpg, jpeg, png, tiff, tif, gif, webp, ppm
1753
+ and bmp. Photos that are larger than 20MB in size won't be converted to
1754
+ a thumbnail.
1738
1755
1739
1756
:param resource: Information specifying which file to preview. This
1740
1757
could be a path to a file, a shared link pointing to a file, or a
@@ -1781,7 +1798,10 @@ def files_get_thumbnail_to_file_v2(self,
1781
1798
size = files .ThumbnailSize .w64h64 ,
1782
1799
mode = files .ThumbnailMode .strict ):
1783
1800
"""
1784
- Get a thumbnail for a file.
1801
+ Get a thumbnail for an image. This method currently supports files with
1802
+ the following file extensions: jpg, jpeg, png, tiff, tif, gif, webp, ppm
1803
+ and bmp. Photos that are larger than 20MB in size won't be converted to
1804
+ a thumbnail.
1785
1805
1786
1806
:param str download_path: Path on local machine to save file.
1787
1807
:param resource: Information specifying which file to preview. This
@@ -1821,8 +1841,9 @@ def files_get_thumbnail_batch(self,
1821
1841
"""
1822
1842
Get thumbnails for a list of images. We allow up to 25 thumbnails in a
1823
1843
single batch. This method currently supports files with the following
1824
- file extensions: jpg, jpeg, png, tiff, tif, gif and bmp. Photos that are
1825
- larger than 20MB in size won't be converted to a thumbnail.
1844
+ file extensions: jpg, jpeg, png, tiff, tif, gif, webp, ppm and bmp.
1845
+ Photos that are larger than 20MB in size won't be converted to a
1846
+ thumbnail.
1826
1847
1827
1848
:param List[:class:`dropbox.files.ThumbnailArg`] entries: List of files
1828
1849
to get thumbnails.
@@ -2826,7 +2847,7 @@ def files_upload_session_append(self,
2826
2847
:param bytes f: Contents to upload.
2827
2848
:param str session_id: The upload session ID (returned by
2828
2849
:meth:`files_upload_session_start`).
2829
- :param int offset: The amount of data that has been uploaded so far . We
2850
+ :param int offset: Offset in bytes at which data should be appended . We
2830
2851
use this to make sure upload data isn't lost or duplicated in the
2831
2852
event of a network error.
2832
2853
:rtype: None
@@ -2958,15 +2979,14 @@ def files_upload_session_start(self,
2958
2979
:meth:`files_upload_session_finish` to save all the data to a file in
2959
2980
Dropbox. A single request should not upload more than 150 MB. The
2960
2981
maximum size of a file one can upload to an upload session is 350 GB. An
2961
- upload session can be used for a maximum of 48 hours . Attempting to use
2962
- an ``UploadSessionStartResult.session_id`` with
2982
+ upload session can be used for a maximum of 7 days . Attempting to use an
2983
+ ``UploadSessionStartResult.session_id`` with
2963
2984
:meth:`files_upload_session_append_v2` or
2964
- :meth:`files_upload_session_finish` more than 48 hours after its
2965
- creation will return a ``UploadSessionLookupError.not_found``. Calls to
2966
- this endpoint will count as data transport calls for any Dropbox
2967
- Business teams with a limit on the number of data transport calls
2968
- allowed per month. For more information, see the `Data transport limit
2969
- page
2985
+ :meth:`files_upload_session_finish` more than 7 days after its creation
2986
+ will return a ``UploadSessionLookupError.not_found``. Calls to this
2987
+ endpoint will count as data transport calls for any Dropbox Business
2988
+ teams with a limit on the number of data transport calls allowed per
2989
+ month. For more information, see the `Data transport limit page
2970
2990
<https://www.dropbox.com/developers/reference/data-transport-limit>`_.
2971
2991
By default, upload sessions require you to send content of the file in
2972
2992
sequential order via consecutive :meth:`files_upload_session_start`,
0 commit comments