[Python-modules-commits] [python-dropbox] 05/09: New upstream version 8.4.0
Michael Fladischer
fladi at moszumanska.debian.org
Tue Oct 17 18:16:53 UTC 2017
This is an automated email from the git hooks/post-receive script.
fladi pushed a commit to branch debian/master
in repository python-dropbox.
commit 169f38982f868e7020f04f515a9c82272ea87971
Author: Michael Fladischer <FladischerMichael at fladi.at>
Date: Tue Oct 17 18:29:05 2017 +0200
New upstream version 8.4.0
---
PKG-INFO | 4 +-
README.rst | 2 +-
dropbox.egg-info/PKG-INFO | 4 +-
dropbox.egg-info/SOURCES.txt | 2 +
dropbox.egg-info/requires.txt | 3 +-
dropbox/base.py | 974 ++-
dropbox/base_team.py | 288 +-
dropbox/common.py | 48 +-
dropbox/dropbox.py | 2 +-
dropbox/file_properties.py | 2959 ++++++++
dropbox/file_requests.py | 1434 ++++
dropbox/files.py | 1964 +++---
dropbox/oauth.py | 14 +-
dropbox/paper.py | 719 ++
dropbox/sharing.py | 1064 ++-
dropbox/team.py | 2396 +++++--
dropbox/team_log.py | 15107 +++++++++++++++++++++++-----------------
dropbox/team_policies.py | 516 +-
dropbox/users.py | 48 +-
dropbox/users_common.py | 2 +-
setup.cfg | 1 +
setup.py | 3 +-
22 files changed, 19217 insertions(+), 8337 deletions(-)
diff --git a/PKG-INFO b/PKG-INFO
index 2cbfc5f..6d5501d 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: dropbox
-Version: 8.0.0
+Version: 8.4.0
Summary: Official Dropbox API Client
Home-page: http://www.dropbox.com/developers
Author: Dropbox
@@ -9,7 +9,7 @@ License: MIT License
Description: Dropbox for Python
==================
- .. image:: https://travis-ci.org/dropbox/dropbox-sdk-python.svg?branch=v8.0.0
+ .. image:: https://travis-ci.org/dropbox/dropbox-sdk-python.svg?branch=v8.4.0
:target: https://travis-ci.org/dropbox/dropbox-sdk-python
.. image:: https://readthedocs.org/projects/dropbox-sdk-python/badge/?version=stable
diff --git a/README.rst b/README.rst
index 82259d8..1520a04 100644
--- a/README.rst
+++ b/README.rst
@@ -1,7 +1,7 @@
Dropbox for Python
==================
-.. image:: https://travis-ci.org/dropbox/dropbox-sdk-python.svg?branch=v8.0.0
+.. image:: https://travis-ci.org/dropbox/dropbox-sdk-python.svg?branch=v8.4.0
:target: https://travis-ci.org/dropbox/dropbox-sdk-python
.. image:: https://readthedocs.org/projects/dropbox-sdk-python/badge/?version=stable
diff --git a/dropbox.egg-info/PKG-INFO b/dropbox.egg-info/PKG-INFO
index 2cbfc5f..6d5501d 100644
--- a/dropbox.egg-info/PKG-INFO
+++ b/dropbox.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: dropbox
-Version: 8.0.0
+Version: 8.4.0
Summary: Official Dropbox API Client
Home-page: http://www.dropbox.com/developers
Author: Dropbox
@@ -9,7 +9,7 @@ License: MIT License
Description: Dropbox for Python
==================
- .. image:: https://travis-ci.org/dropbox/dropbox-sdk-python.svg?branch=v8.0.0
+ .. image:: https://travis-ci.org/dropbox/dropbox-sdk-python.svg?branch=v8.4.0
:target: https://travis-ci.org/dropbox/dropbox-sdk-python
.. image:: https://readthedocs.org/projects/dropbox-sdk-python/badge/?version=stable
diff --git a/dropbox.egg-info/SOURCES.txt b/dropbox.egg-info/SOURCES.txt
index 6c30c75..84f53e3 100644
--- a/dropbox.egg-info/SOURCES.txt
+++ b/dropbox.egg-info/SOURCES.txt
@@ -12,6 +12,8 @@ dropbox/base_team.py
dropbox/common.py
dropbox/dropbox.py
dropbox/exceptions.py
+dropbox/file_properties.py
+dropbox/file_requests.py
dropbox/files.py
dropbox/oauth.py
dropbox/paper.py
diff --git a/dropbox.egg-info/requires.txt b/dropbox.egg-info/requires.txt
index d7643c8..918e4f0 100644
--- a/dropbox.egg-info/requires.txt
+++ b/dropbox.egg-info/requires.txt
@@ -1,3 +1,2 @@
-requests >= 2.5.1, != 2.6.1, !=2.16.0, !=2.16.1
+requests >= 2.16.2
six >= 1.3.0
-urllib3
diff --git a/dropbox/base.py b/dropbox/base.py
index 988448f..583839c 100644
--- a/dropbox/base.py
+++ b/dropbox/base.py
@@ -10,9 +10,10 @@ from . import (
async,
auth,
common,
+ file_properties,
+ file_requests,
files,
paper,
- properties,
sharing,
team,
team_common,
@@ -75,6 +76,477 @@ class DropboxBase(object):
return None
# ------------------------------------------
+ # Routes in file_properties namespace
+
+ def file_properties_properties_add(self,
+ path,
+ property_groups):
+ """
+ Add property groups to a Dropbox file. See
+ :meth:`file_properties_templates_add_for_user` or
+ :meth:`file_properties_templates_add_for_team` to create new templates.
+
+ :param str path: A unique identifier for the file or folder.
+ :param list property_groups: The property groups which are to be added
+ to a Dropbox file.
+ :rtype: None
+ :raises: :class:`dropbox.exceptions.ApiError`
+
+ If this raises, ApiError.reason is of type:
+ :class:`dropbox.file_properties.AddPropertiesError`
+ """
+ arg = file_properties.AddPropertiesArg(path,
+ property_groups)
+ r = self.request(
+ file_properties.properties_add,
+ 'file_properties',
+ arg,
+ None,
+ )
+ return None
+
+ def file_properties_properties_overwrite(self,
+ path,
+ property_groups):
+ """
+ Overwrite property groups associated with a file. This endpoint should
+ be used instead of :meth:`file_properties_properties_update` when
+ property groups are being updated via a "snapshot" instead of via a
+ "delta". In other words, this endpoint will delete all omitted fields
+ from a property group, whereas :meth:`file_properties_properties_update`
+ will only delete fields that are explicitly marked for deletion.
+
+ :param str path: A unique identifier for the file or folder.
+ :param list property_groups: The property groups "snapshot" updates to
+ force apply.
+ :rtype: None
+ :raises: :class:`dropbox.exceptions.ApiError`
+
+ If this raises, ApiError.reason is of type:
+ :class:`dropbox.file_properties.InvalidPropertyGroupError`
+ """
+ arg = file_properties.OverwritePropertyGroupArg(path,
+ property_groups)
+ r = self.request(
+ file_properties.properties_overwrite,
+ 'file_properties',
+ arg,
+ None,
+ )
+ return None
+
+ def file_properties_properties_remove(self,
+ path,
+ property_template_ids):
+ """
+ Remove the specified property group from the file. To remove specific
+ property field key value pairs, see
+ :meth:`file_properties_properties_update`. To update a template, see
+ :meth:`file_properties_templates_update_for_user` or
+ :meth:`file_properties_templates_update_for_team`. Templates can't be
+ removed once created.
+
+ :param str path: A unique identifier for the file or folder.
+ :param list property_template_ids: A list of identifiers for a template
+ created by :meth:`file_properties_templates_add_for_user` or
+ :meth:`file_properties_templates_add_for_team`.
+ :rtype: None
+ :raises: :class:`dropbox.exceptions.ApiError`
+
+ If this raises, ApiError.reason is of type:
+ :class:`dropbox.file_properties.RemovePropertiesError`
+ """
+ arg = file_properties.RemovePropertiesArg(path,
+ property_template_ids)
+ r = self.request(
+ file_properties.properties_remove,
+ 'file_properties',
+ arg,
+ None,
+ )
+ return None
+
+ def file_properties_properties_search(self,
+ queries,
+ template_filter=file_properties.TemplateFilter.filter_none):
+ """
+ Search across property templates for particular property field values.
+
+ :param list queries: Queries to search.
+ :param template_filter: Filter results to contain only properties
+ associated with these template IDs.
+ :type template_filter: :class:`dropbox.file_properties.TemplateFilter`
+ :rtype: :class:`dropbox.file_properties.PropertiesSearchResult`
+ :raises: :class:`dropbox.exceptions.ApiError`
+
+ If this raises, ApiError.reason is of type:
+ :class:`dropbox.file_properties.PropertiesSearchError`
+ """
+ arg = file_properties.PropertiesSearchArg(queries,
+ template_filter)
+ r = self.request(
+ file_properties.properties_search,
+ 'file_properties',
+ arg,
+ None,
+ )
+ return r
+
+ def file_properties_properties_update(self,
+ path,
+ update_property_groups):
+ """
+ Add, update or remove properties associated with the supplied file and
+ templates. This endpoint should be used instead of
+ :meth:`file_properties_properties_overwrite` when property groups are
+ being updated via a "delta" instead of via a "snapshot" . In other
+ words, this endpoint will not delete any omitted fields from a property
+ group, whereas :meth:`file_properties_properties_overwrite` will delete
+ any fields that are omitted from a property group.
+
+ :param str path: A unique identifier for the file or folder.
+ :param list update_property_groups: The property groups "delta" updates
+ to apply.
+ :rtype: None
+ :raises: :class:`dropbox.exceptions.ApiError`
+
+ If this raises, ApiError.reason is of type:
+ :class:`dropbox.file_properties.UpdatePropertiesError`
+ """
+ arg = file_properties.UpdatePropertiesArg(path,
+ update_property_groups)
+ r = self.request(
+ file_properties.properties_update,
+ 'file_properties',
+ arg,
+ None,
+ )
+ return None
+
+ def file_properties_templates_add_for_team(self,
+ name,
+ description,
+ fields):
+ """
+ Add a template associated with a team. See
+ :meth:`file_properties_properties_add` to add properties to a file or
+ folder.
+
+ :rtype: :class:`dropbox.file_properties.AddTemplateResult`
+ :raises: :class:`dropbox.exceptions.ApiError`
+
+ If this raises, ApiError.reason is of type:
+ :class:`dropbox.file_properties.ModifyTemplateError`
+ """
+ arg = file_properties.AddTemplateArg(name,
+ description,
+ fields)
+ r = self.request(
+ file_properties.templates_add_for_team,
+ 'file_properties',
+ arg,
+ None,
+ )
+ return r
+
+ def file_properties_templates_add_for_user(self,
+ name,
+ description,
+ fields):
+ """
+ Add a template associated with a user. See
+ :meth:`file_properties_properties_add` to add properties to a file. This
+ endpoint can't be called on a team member or admin's behalf.
+
+ :rtype: :class:`dropbox.file_properties.AddTemplateResult`
+ :raises: :class:`dropbox.exceptions.ApiError`
+
+ If this raises, ApiError.reason is of type:
+ :class:`dropbox.file_properties.ModifyTemplateError`
+ """
+ arg = file_properties.AddTemplateArg(name,
+ description,
+ fields)
+ r = self.request(
+ file_properties.templates_add_for_user,
+ 'file_properties',
+ arg,
+ None,
+ )
+ return r
+
+ def file_properties_templates_get_for_team(self,
+ template_id):
+ """
+ Get the schema for a specified template.
+
+ :param str template_id: An identifier for template added by route See
+ :meth:`file_properties_templates_add_for_user` or
+ :meth:`file_properties_templates_add_for_team`.
+ :rtype: :class:`dropbox.file_properties.GetTemplateResult`
+ :raises: :class:`dropbox.exceptions.ApiError`
+
+ If this raises, ApiError.reason is of type:
+ :class:`dropbox.file_properties.TemplateError`
+ """
+ arg = file_properties.GetTemplateArg(template_id)
+ r = self.request(
+ file_properties.templates_get_for_team,
+ 'file_properties',
+ arg,
+ None,
+ )
+ return r
+
+ def file_properties_templates_get_for_user(self,
+ template_id):
+ """
+ Get the schema for a specified template. This endpoint can't be called
+ on a team member or admin's behalf.
+
+ :param str template_id: An identifier for template added by route See
+ :meth:`file_properties_templates_add_for_user` or
+ :meth:`file_properties_templates_add_for_team`.
+ :rtype: :class:`dropbox.file_properties.GetTemplateResult`
+ :raises: :class:`dropbox.exceptions.ApiError`
+
+ If this raises, ApiError.reason is of type:
+ :class:`dropbox.file_properties.TemplateError`
+ """
+ arg = file_properties.GetTemplateArg(template_id)
+ r = self.request(
+ file_properties.templates_get_for_user,
+ 'file_properties',
+ arg,
+ None,
+ )
+ return r
+
+ def file_properties_templates_list_for_team(self):
+ """
+ Get the template identifiers for a team. To get the schema of each
+ template use :meth:`file_properties_templates_get_for_team`.
+
+ :rtype: :class:`dropbox.file_properties.ListTemplateResult`
+ :raises: :class:`dropbox.exceptions.ApiError`
+
+ If this raises, ApiError.reason is of type:
+ :class:`dropbox.file_properties.TemplateError`
+ """
+ arg = None
+ r = self.request(
+ file_properties.templates_list_for_team,
+ 'file_properties',
+ arg,
+ None,
+ )
+ return r
+
+ def file_properties_templates_list_for_user(self):
+ """
+ Get the template identifiers for a team. To get the schema of each
+ template use :meth:`file_properties_templates_get_for_user`. This
+ endpoint can't be called on a team member or admin's behalf.
+
+ :rtype: :class:`dropbox.file_properties.ListTemplateResult`
+ :raises: :class:`dropbox.exceptions.ApiError`
+
+ If this raises, ApiError.reason is of type:
+ :class:`dropbox.file_properties.TemplateError`
+ """
+ arg = None
+ r = self.request(
+ file_properties.templates_list_for_user,
+ 'file_properties',
+ arg,
+ None,
+ )
+ return r
+
+ def file_properties_templates_update_for_team(self,
+ template_id,
+ name=None,
+ description=None,
+ add_fields=None):
+ """
+ Update a template associated with a team. This route can update the
+ template name, the template description and add optional properties to
+ templates.
+
+ :param str template_id: An identifier for template added by See
+ :meth:`file_properties_templates_add_for_user` or
+ :meth:`file_properties_templates_add_for_team`.
+ :param Nullable name: A display name for the template. template names
+ can be up to 256 bytes.
+ :param Nullable description: Description for the new template. Template
+ descriptions can be up to 1024 bytes.
+ :param Nullable add_fields: Property field templates to be added to the
+ group template. There can be up to 32 properties in a single
+ template.
+ :rtype: :class:`dropbox.file_properties.UpdateTemplateResult`
+ :raises: :class:`dropbox.exceptions.ApiError`
+
+ If this raises, ApiError.reason is of type:
+ :class:`dropbox.file_properties.ModifyTemplateError`
+ """
+ arg = file_properties.UpdateTemplateArg(template_id,
+ name,
+ description,
+ add_fields)
+ r = self.request(
+ file_properties.templates_update_for_team,
+ 'file_properties',
+ arg,
+ None,
+ )
+ return r
+
+ def file_properties_templates_update_for_user(self,
+ template_id,
+ name=None,
+ description=None,
+ add_fields=None):
+ """
+ Update a template associated with a user. This route can update the
+ template name, the template description and add optional properties to
+ templates. This endpoint can't be called on a team member or admin's
+ behalf.
+
+ :param str template_id: An identifier for template added by See
+ :meth:`file_properties_templates_add_for_user` or
+ :meth:`file_properties_templates_add_for_team`.
+ :param Nullable name: A display name for the template. template names
+ can be up to 256 bytes.
+ :param Nullable description: Description for the new template. Template
+ descriptions can be up to 1024 bytes.
+ :param Nullable add_fields: Property field templates to be added to the
+ group template. There can be up to 32 properties in a single
+ template.
+ :rtype: :class:`dropbox.file_properties.UpdateTemplateResult`
+ :raises: :class:`dropbox.exceptions.ApiError`
+
+ If this raises, ApiError.reason is of type:
+ :class:`dropbox.file_properties.ModifyTemplateError`
+ """
+ arg = file_properties.UpdateTemplateArg(template_id,
+ name,
+ description,
+ add_fields)
+ r = self.request(
+ file_properties.templates_update_for_user,
+ 'file_properties',
+ arg,
+ None,
+ )
+ return r
+
+ # ------------------------------------------
+ # Routes in file_requests namespace
+
+ def file_requests_create(self,
+ title,
+ destination,
+ deadline=None,
+ open=True):
+ """
+ Creates a file request for this user.
+
+ :param str title: The title of the file request. Must not be empty.
+ :param str destination: The path of the folder in the Dropbox where
+ uploaded files will be sent. For apps with the app folder
+ permission, this will be relative to the app folder.
+ :param Nullable deadline: The deadline for the file request. Deadlines
+ can only be set by Pro and Business accounts.
+ :param bool open: Whether or not the file request should be open. If the
+ file request is closed, it will not accept any file submissions, but
+ it can be opened later.
+ :rtype: :class:`dropbox.file_requests.FileRequest`
+ :raises: :class:`dropbox.exceptions.ApiError`
+
+ If this raises, ApiError.reason is of type:
+ :class:`dropbox.file_requests.CreateFileRequestError`
+ """
+ arg = file_requests.CreateFileRequestArgs(title,
+ destination,
+ deadline,
+ open)
+ r = self.request(
+ file_requests.create,
+ 'file_requests',
+ arg,
+ None,
+ )
+ return r
+
+ def file_requests_get(self,
+ id):
+ """
+ Returns the specified file request.
+
+ :param str id: The ID of the file request to retrieve.
+ :rtype: :class:`dropbox.file_requests.FileRequest`
+ """
+ arg = file_requests.GetFileRequestArgs(id)
+ r = self.request(
+ file_requests.get,
+ 'file_requests',
+ arg,
+ None,
+ )
+ return r
+
+ def file_requests_list(self):
+ """
+ Returns a list of file requests owned by this user. For apps with the
+ app folder permission, this will only return file requests with
+ destinations in the app folder.
+
+ :rtype: :class:`dropbox.file_requests.ListFileRequestsResult`
+ """
+ arg = None
+ r = self.request(
+ file_requests.list,
+ 'file_requests',
+ arg,
+ None,
+ )
+ return r
+
+ def file_requests_update(self,
+ id,
+ title=None,
+ destination=None,
+ deadline=file_requests.UpdateFileRequestDeadline.no_update,
+ open=None):
+ """
+ Update a file request.
+
+ :param str id: The ID of the file request to update.
+ :param Nullable title: The new title of the file request. Must not be
+ empty.
+ :param Nullable destination: The new path of the folder in the Dropbox
+ where uploaded files will be sent. For apps with the app folder
+ permission, this will be relative to the app folder.
+ :param deadline: The new deadline for the file request.
+ :type deadline: :class:`dropbox.file_requests.UpdateFileRequestDeadline`
+ :param Nullable open: Whether to set this file request as open or
+ closed.
+ :rtype: :class:`dropbox.file_requests.FileRequest`
+ """
+ arg = file_requests.UpdateFileRequestArgs(id,
+ title,
+ destination,
+ deadline,
+ open)
+ r = self.request(
+ file_requests.update,
+ 'file_requests',
+ arg,
+ None,
+ )
+ return r
+
+ # ------------------------------------------
# Routes in files namespace
def files_alpha_get_metadata(self,
@@ -152,7 +624,8 @@ class DropboxBase(object):
from_path,
to_path,
allow_shared_folder=False,
- autorename=False):
+ autorename=False,
+ allow_ownership_transfer=False):
"""
Copy a file or folder to a different location in the user's Dropbox. If
the source path is a folder all its contents will be copied.
@@ -164,16 +637,24 @@ class DropboxBase(object):
:meth:`files_move`.
:param bool autorename: If there's a conflict, have the Dropbox server
try to autorename the file to avoid the conflict.
+ :param bool allow_ownership_transfer: Allow moves by owner even if it
+ would result in an ownership transfer for the content being moved.
+ This does not apply to copies.
:rtype: :class:`dropbox.files.Metadata`
:raises: :class:`dropbox.exceptions.ApiError`
If this raises, ApiError.reason is of type:
:class:`dropbox.files.RelocationError`
"""
+ warnings.warn(
+ 'copy is deprecated. Use copy_v2.',
+ DeprecationWarning,
+ )
arg = files.RelocationArg(from_path,
to_path,
allow_shared_folder,
- autorename)
+ autorename,
+ allow_ownership_transfer)
r = self.request(
files.copy,
'files',
@@ -185,7 +666,8 @@ class DropboxBase(object):
def files_copy_batch(self,
entries,
allow_shared_folder=False,
- autorename=False):
+ autorename=False,
+ allow_ownership_transfer=False):
"""
Copy multiple files or folders to different locations at once in the
user's Dropbox. If ``RelocationBatchArg.allow_shared_folder`` is false,
@@ -205,11 +687,15 @@ class DropboxBase(object):
always true for :meth:`files_move_batch`.
:param bool autorename: If there's a conflict with any file, have the
Dropbox server try to autorename that file to avoid the conflict.
+ :param bool allow_ownership_transfer: Allow moves by owner even if it
+ would result in an ownership transfer for the content being moved.
+ This does not apply to copies.
:rtype: :class:`dropbox.files.RelocationBatchLaunch`
"""
arg = files.RelocationBatchArg(entries,
allow_shared_folder,
- autorename)
+ autorename,
+ allow_ownership_transfer)
r = self.request(
files.copy_batch,
'files',
@@ -291,6 +777,45 @@ class DropboxBase(object):
)
return r
+ def files_copy_v2(self,
+ from_path,
+ to_path,
+ allow_shared_folder=False,
+ autorename=False,
+ allow_ownership_transfer=False):
+ """
+ Copy a file or folder to a different location in the user's Dropbox. If
+ the source path is a folder all its contents will be copied.
+
+ :param bool allow_shared_folder: If true, :meth:`files_copy` will copy
+ contents in shared folder, otherwise
+ ``RelocationError.cant_copy_shared_folder`` will be returned if
+ ``from_path`` contains shared folder. This field is always true for
+ :meth:`files_move`.
+ :param bool autorename: If there's a conflict, have the Dropbox server
+ try to autorename the file to avoid the conflict.
+ :param bool allow_ownership_transfer: Allow moves by owner even if it
+ would result in an ownership transfer for the content being moved.
+ This does not apply to copies.
+ :rtype: :class:`dropbox.files.RelocationResult`
+ :raises: :class:`dropbox.exceptions.ApiError`
+
+ If this raises, ApiError.reason is of type:
+ :class:`dropbox.files.RelocationError`
+ """
+ arg = files.RelocationArg(from_path,
+ to_path,
+ allow_shared_folder,
+ autorename,
+ allow_ownership_transfer)
+ r = self.request(
+ files.copy_v2,
+ 'files',
+ arg,
+ None,
+ )
+ return r
+
def files_create_folder(self,
path,
autorename=False):
@@ -306,6 +831,10 @@ class DropboxBase(object):
If this raises, ApiError.reason is of type:
:class:`dropbox.files.CreateFolderError`
"""
+ warnings.warn(
+ 'create_folder is deprecated. Use create_folder_v2.',
+ DeprecationWarning,
+ )
arg = files.CreateFolderArg(path,
autorename)
r = self.request(
@@ -316,6 +845,31 @@ class DropboxBase(object):
)
return r
+ def files_create_folder_v2(self,
+ path,
+ autorename=False):
+ """
+ Create a folder at a given path.
+
+ :param str path: Path in the user's Dropbox to create.
+ :param bool autorename: If there's a conflict, have the Dropbox server
+ try to autorename the folder to avoid the conflict.
+ :rtype: :class:`dropbox.files.CreateFolderResult`
+ :raises: :class:`dropbox.exceptions.ApiError`
+
+ If this raises, ApiError.reason is of type:
+ :class:`dropbox.files.CreateFolderError`
+ """
+ arg = files.CreateFolderArg(path,
+ autorename)
+ r = self.request(
+ files.create_folder_v2,
+ 'files',
+ arg,
+ None,
+ )
+ return r
+
def files_delete(self,
path):
"""
@@ -333,6 +887,10 @@ class DropboxBase(object):
If this raises, ApiError.reason is of type:
:class:`dropbox.files.DeleteError`
"""
+ warnings.warn(
+ 'delete is deprecated. Use delete_v2.',
+ DeprecationWarning,
+ )
arg = files.DeleteArg(path)
r = self.request(
files.delete,
@@ -385,6 +943,32 @@ class DropboxBase(object):
)
return r
+ def files_delete_v2(self,
+ path):
+ """
+ Delete the file or folder at a given path. If the path is a folder, all
+ its contents will be deleted too. A successful response indicates that
+ the file or folder was deleted. The returned metadata will be the
+ corresponding :class:`dropbox.files.FileMetadata` or
+ :class:`dropbox.files.FolderMetadata` for the item at time of deletion,
+ and not a :class:`dropbox.files.DeletedMetadata` object.
+
+ :param str path: Path in the user's Dropbox to delete.
+ :rtype: :class:`dropbox.files.DeleteResult`
+ :raises: :class:`dropbox.exceptions.ApiError`
+
+ If this raises, ApiError.reason is of type:
+ :class:`dropbox.files.DeleteError`
+ """
+ arg = files.DeleteArg(path)
+ r = self.request(
+ files.delete_v2,
+ 'files',
+ arg,
+ None,
+ )
+ return r
+
def files_download(self,
path,
rev=None):
@@ -392,8 +976,7 @@ class DropboxBase(object):
Download a file from a user's Dropbox.
:param str path: The path of the file to download.
- :param Nullable rev: Deprecated. Please specify revision in ``path``
- instead.
+ :param Nullable rev: Please specify revision in ``path`` instead.
:rtype: (:class:`dropbox.files.FileMetadata`,
:class:`requests.models.Response`)
:raises: :class:`dropbox.exceptions.ApiError`
@@ -426,8 +1009,7 @@ class DropboxBase(object):
:param str download_path: Path on local machine to save file.
:param str path: The path of the file to download.
- :param Nullable rev: Deprecated. Please specify revision in ``path``
- instead.
+ :param Nullable rev: Please specify revision in ``path`` instead.
:rtype: (:class:`dropbox.files.FileMetadata`,
:class:`requests.models.Response`)
:raises: :class:`dropbox.exceptions.ApiError`
@@ -494,8 +1076,7 @@ class DropboxBase(object):
.xlsm, .xlsx. Other formats will return an unsupported extension error.
:param str path: The path of the file to preview.
- :param Nullable rev: Deprecated. Please specify revision in ``path``
- instead.
+ :param Nullable rev: Please specify revision in ``path`` instead.
:rtype: (:class:`dropbox.files.FileMetadata`,
:class:`requests.models.Response`)
:raises: :class:`dropbox.exceptions.ApiError`
@@ -532,8 +1113,7 @@ class DropboxBase(object):
:param str download_path: Path on local machine to save file.
:param str path: The path of the file to preview.
- :param Nullable rev: Deprecated. Please specify revision in ``path``
- instead.
+ :param Nullable rev: Please specify revision in ``path`` instead.
:rtype: (:class:`dropbox.files.FileMetadata`,
:class:`requests.models.Response`)
:raises: :class:`dropbox.exceptions.ApiError`
@@ -654,12 +1234,39 @@ class DropboxBase(object):
self._save_body_to_file(download_path, r[1])
return r[0]
+ def files_get_thumbnail_batch(self,
+ entries):
+ """
+ Get thumbnails for a list of images. We allow up to 25 thumbnails in a
+ single batch. This method currently supports files with the following
+ file extensions: jpg, jpeg, png, tiff, tif, gif and bmp. Photos that are
+ larger than 20MB in size won't be converted to a thumbnail.
+
+ :param list entries: List of files to get thumbnails.
+ :rtype: :class:`dropbox.files.GetThumbnailBatchResult`
+ :raises: :class:`dropbox.exceptions.ApiError`
+
+ If this raises, ApiError.reason is of type:
+ :class:`dropbox.files.GetThumbnailBatchError`
+ """
+ arg = files.GetThumbnailBatchArg(entries)
+ r = self.request(
+ files.get_thumbnail_batch,
+ 'files',
+ arg,
+ None,
+ )
+ return r
+
def files_list_folder(self,
path,
recursive=False,
include_media_info=False,
include_deleted=False,
- include_has_explicit_shared_members=False):
+ include_has_explicit_shared_members=False,
+ include_mounted_folders=True,
+ limit=None,
+ shared_link=None):
"""
Starts returning the contents of a folder. If the result's
``ListFolderResult.has_more`` field is ``True``, call
@@ -686,7 +1293,7 @@ class DropboxBase(object):
user. If your app implements retry logic, please hold off the retry
until the previous request finishes.
- :param str path: The path to the folder you want to see the contents of.
+ :param str path: A unique identifier for the file.
:param bool recursive: If true, the list folder operation will be
applied recursively to all subfolders and the response will contain
contents of all subfolders.
@@ -697,6 +1304,17 @@ class DropboxBase(object):
:param bool include_has_explicit_shared_members: If true, the results
will include a flag for each file indicating whether or not that
file has any explicit members.
+ :param bool include_mounted_folders: If true, the results will include
+ entries under mounted folders which includes app folder, shared
+ folder and team folder.
+ :param Nullable limit: The maximum number of results to return per
+ request. Note: This is an approximate number and there can be
+ slightly more entries returned in some cases.
+ :param Nullable shared_link: A shared link to list the contents of. If
+ the link is password-protected, the password must be provided. If
+ this field is present, ``ListFolderArg.path`` will be relative to
+ root of the shared link. Only non-recursive mode is supported for
+ shared link.
:rtype: :class:`dropbox.files.ListFolderResult`
:raises: :class:`dropbox.exceptions.ApiError`
@@ -707,7 +1325,10 @@ class DropboxBase(object):
recursive,
include_media_info,
include_deleted,
- include_has_explicit_shared_members)
+ include_has_explicit_shared_members,
+ include_mounted_folders,
+ limit,
+ shared_link)
r = self.request(
files.list_folder,
'files',
@@ -745,7 +1366,10 @@ class DropboxBase(object):
recursive=False,
include_media_info=False,
include_deleted=False,
- include_has_explicit_shared_members=False):
+ include_has_explicit_shared_members=False,
+ include_mounted_folders=True,
+ limit=None,
+ shared_link=None):
"""
A way to quickly get a cursor for the folder's state. Unlike
:meth:`files_list_folder`, :meth:`files_list_folder_get_latest_cursor`
@@ -753,7 +1377,7 @@ class DropboxBase(object):
know about new files and modifications and doesn't need to know about
files that already exist in Dropbox.
- :param str path: The path to the folder you want to see the contents of.
+ :param str path: A unique identifier for the file.
:param bool recursive: If true, the list folder operation will be
applied recursively to all subfolders and the response will contain
contents of all subfolders.
@@ -764,6 +1388,17 @@ class DropboxBase(object):
:param bool include_has_explicit_shared_members: If true, the results
will include a flag for each file indicating whether or not that
file has any explicit members.
+ :param bool include_mounted_folders: If true, the results will include
+ entries under mounted folders which includes app folder, shared
+ folder and team folder.
+ :param Nullable limit: The maximum number of results to return per
+ request. Note: This is an approximate number and there can be
+ slightly more entries returned in some cases.
+ :param Nullable shared_link: A shared link to list the contents of. If
+ the link is password-protected, the password must be provided. If
+ this field is present, ``ListFolderArg.path`` will be relative to
+ root of the shared link. Only non-recursive mode is supported for
+ shared link.
:rtype: :class:`dropbox.files.ListFolderGetLatestCursorResult`
:raises: :class:`dropbox.exceptions.ApiError`
@@ -774,7 +1409,10 @@ class DropboxBase(object):
recursive,
include_media_info,
include_deleted,
- include_has_explicit_shared_members)
+ include_has_explicit_shared_members,
+ include_mounted_folders,
+ limit,
+ shared_link)
r = self.request(
files.list_folder_get_latest_cursor,
'files',
@@ -821,11 +1459,23 @@ class DropboxBase(object):
def files_list_revisions(self,
path,
+ mode=files.ListRevisionsMode.path,
limit=10):
"""
- Return revisions of a file.
+ Returns revisions for files based on a file path or a file id. The file
+ path or file id is identified from the latest file entry at the given
+ file path or id. This end point allows your app to query either by file
+ path or file id by setting the mode parameter appropriately. In the
+ ``ListRevisionsMode.path`` (default) mode, all revisions at the same
+ file path as the latest file entry are returned. If revisions with the
+ same file id are desired, then mode must be set to
+ ``ListRevisionsMode.id``. The ``ListRevisionsMode.id`` mode is useful to
+ retrieve revisions for a given file across moves or renames.
:param str path: The path to the file you want to see the revisions of.
+ :param mode: Determines the behavior of the API in listing the revisions
+ for a given file path or id.
+ :type mode: :class:`dropbox.files.ListRevisionsMode`
:param long limit: The maximum number of revision entries returned.
:rtype: :class:`dropbox.files.ListRevisionsResult`
:raises: :class:`dropbox.exceptions.ApiError`
@@ -834,6 +1484,7 @@ class DropboxBase(object):
:class:`dropbox.files.ListRevisionsError`
"""
arg = files.ListRevisionsArg(path,
+ mode,
limit)
r = self.request(
... 37842 lines suppressed ...
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-dropbox.git
More information about the Python-modules-commits
mailing list