dropbox.common – Common

class dropbox.common.PathRoot(tag, value=None)

Bases: stone.backends.python_rsrc.stone_base.Union

This class acts as a tagged union. Only one of the is_* methods will return true. To get the associated value of a tag (if one exists), use the corresponding get_* method.

Variables:
get_namespace_id()

Paths are relative to given namespace id (This results in PathRootError.no_permission if you don’t have access to this namespace.).

Only call this if is_namespace_id() is true.

Return type:str
get_root()

Paths are relative to the authenticating user’s root namespace (This results in PathRootError.invalid_root if the user’s root namespace has changed.).

Only call this if is_root() is true.

Return type:str
home = PathRoot(u'home', None)
is_home()

Check if the union tag is home.

Return type:bool
is_namespace_id()

Check if the union tag is namespace_id.

Return type:bool
is_other()

Check if the union tag is other.

Return type:bool
is_root()

Check if the union tag is root.

Return type:bool
classmethod namespace_id(val)

Create an instance of this class set to the namespace_id tag with value val.

Parameters:val (str) –
Return type:PathRoot
other = PathRoot(u'other', None)
classmethod root(val)

Create an instance of this class set to the root tag with value val.

Parameters:val (str) –
Return type:PathRoot
class dropbox.common.PathRootError(tag, value=None)

Bases: stone.backends.python_rsrc.stone_base.Union

This class acts as a tagged union. Only one of the is_* methods will return true. To get the associated value of a tag (if one exists), use the corresponding get_* method.

Variables:
get_invalid_root()

The root namespace id in Dropbox-API-Path-Root header is not valid. The value of this error is the user’s latest root info.

Only call this if is_invalid_root() is true.

Return type:RootInfo
classmethod invalid_root(val)

Create an instance of this class set to the invalid_root tag with value val.

Parameters:val (RootInfo) –
Return type:PathRootError
is_invalid_root()

Check if the union tag is invalid_root.

Return type:bool
is_no_permission()

Check if the union tag is no_permission.

Return type:bool
is_other()

Check if the union tag is other.

Return type:bool
no_permission = PathRootError(u'no_permission', None)
other = PathRootError(u'other', None)
class dropbox.common.RootInfo(root_namespace_id=None, home_namespace_id=None)

Bases: stone.backends.python_rsrc.stone_base.Struct

Information about current user’s root.

Variables:
  • common.RootInfo.root_namespace_id – The namespace ID for user’s root namespace. It will be the namespace ID of the shared team root if the user is member of a team with a separate team root. Otherwise it will be same as RootInfo.home_namespace_id.
  • common.RootInfo.home_namespace_id – The namespace ID for user’s home namespace.
__init__(root_namespace_id=None, home_namespace_id=None)

x.__init__(…) initializes x; see help(type(x)) for signature

home_namespace_id
root_namespace_id
class dropbox.common.TeamRootInfo(root_namespace_id=None, home_namespace_id=None, home_path=None)

Bases: dropbox.common.RootInfo

Root info when user is member of a team with a separate root namespace ID.

Variables:common.TeamRootInfo.home_path – The path for user’s home directory under the shared team root.
__init__(root_namespace_id=None, home_namespace_id=None, home_path=None)

x.__init__(…) initializes x; see help(type(x)) for signature

home_path
class dropbox.common.UserRootInfo(root_namespace_id=None, home_namespace_id=None)

Bases: dropbox.common.RootInfo

Root info when user is not member of a team or the user is a member of a team and the team does not have a separate root namespace.

__init__(root_namespace_id=None, home_namespace_id=None)

x.__init__(…) initializes x; see help(type(x)) for signature