diff --git a/dropbox/base.py b/dropbox/base.py index 8b27e80..4df0920 100644 --- a/dropbox/base.py +++ b/dropbox/base.py @@ -32,7 +32,8 @@ class DropboxBase(object): __metaclass__ = ABCMeta @abstractmethod - def request(self, route, namespace, arg, arg_binary=None): + def request(self, route, namespace, request_arg, request_binary, + timeout=None): pass # ------------------------------------------ diff --git a/dropbox/base_team.py b/dropbox/base_team.py index ff04def..1947f30 100644 --- a/dropbox/base_team.py +++ b/dropbox/base_team.py @@ -32,7 +32,8 @@ class DropboxTeamBase(object): __metaclass__ = ABCMeta @abstractmethod - def request(self, route, namespace, arg, arg_binary=None): + def request(self, route, namespace, request_arg, request_binary, + timeout=None): pass # ------------------------------------------ diff --git a/dropbox/dropbox_client.py b/dropbox/dropbox_client.py index 3ddf824..c6ef987 100644 --- a/dropbox/dropbox_client.py +++ b/dropbox/dropbox_client.py @@ -196,7 +196,7 @@ def __init__(self, if oauth2_refresh_token and not app_key: raise BadInputException("app_key is required to refresh tokens") - if scope is not None and (len(scope) == 0 or not isinstance(scope, list)): + if scope is not None and (not isinstance(scope, list) or len(scope) == 0): raise BadInputException("Scope list must be of type list") self._oauth2_access_token = oauth2_access_token @@ -262,7 +262,7 @@ def clone( oauth2_access_token or self._oauth2_access_token, max_retries_on_error or self._max_retries_on_error, max_retries_on_rate_limit or self._max_retries_on_rate_limit, - user_agent or self._user_agent, + user_agent or self._raw_user_agent, session or self._session, headers or self._headers, timeout or self._timeout, @@ -379,7 +379,7 @@ def refresh_access_token(self, host=API_HOST, scope=None): :param scope: list of permission scopes for access token :return: """ - if scope is not None and (len(scope) == 0 or not isinstance(scope, list)): + if scope is not None and (not isinstance(scope, list) or len(scope) == 0): raise BadInputException("Scope list must be of type list") if not (self._oauth2_refresh_token and self._app_key): diff --git a/dropbox/oauth.py b/dropbox/oauth.py index eaf5d46..4d21a43 100644 --- a/dropbox/oauth.py +++ b/dropbox/oauth.py @@ -121,7 +121,7 @@ class DropboxOAuth2FlowBase(object): def __init__(self, consumer_key, consumer_secret=None, locale=None, token_access_type=None, scope=None, include_granted_scopes=None, use_pkce=False, timeout=DEFAULT_TIMEOUT, ca_certs=None): - if scope is not None and (len(scope) == 0 or not isinstance(scope, list)): + if scope is not None and (not isinstance(scope, list) or len(scope) == 0): raise BadInputException("Scope list must be of type list") if token_access_type is not None and token_access_type not in TOKEN_ACCESS_TYPES: raise BadInputException("Token access type must be from the following enum: {}".format(