Пример #1
0
    def retrieve_share(self, share_key, password=None, debug=False):
        """Instantiate a Share object from a string key.

        Will throw an exception if password is needed but not supplied.

        :note: Cannot use shares created in other applications.

        :param share_key:   String reference to a share created by another user.
        :param password:    Password for the share. Optional, but will throw an exception if a password is required and not provided.
        :param debug:       True if successful, exception otherwise.
        :return:            Share specified by the share key.
        :rtype:             Share object.
        """
        from share import Share
        from errors import SharePasswordError
        try:
           return Share._share_from_share_key(self.rest_interface, share_key, password, debug)
        except SharePasswordError, e:
            raise SharePasswordError(e.request, e.response, e.message, e.INTERNAL_CODE)