Exemplo n.º 1
0
    def publish_beta_blogger(self, owner_userid, export_info, image_ids, title,
                             description, options):
        """
		Publishes to beta-blogger.

		@param owner_username: User making the post
		@type owner_username: String

		@param export_id: User's export service they are wanting to publish with
		@type export_id: Integer

		@param media_ids: List of media id's to be published
		@type media_ids: List

		@param title: Title of the post
		@type title: String

		@param description: Body of the post
		@type description: String

		@param options: Options to be used for the post (alignment, etc)
		@type options: Dictionary
		"""
        self.log.debug("publish_blogger_beta: %s" % pformat(options))
        try:
            owner_userid = validation.cast_integer(owner_userid,
                                                   'owner_userid')
            validation.sequence(image_ids, 'image_ids')
            title = validation.string(title)
            validation.string(description)
            options = validation.dict_keys(options,
                                           ('alignment', 'image_size'),
                                           'options')
        except errors.ValidationError, ex:
            return utils.return_deferred_error(ex.value)
Exemplo n.º 2
0
    def set_account_album_permission(self, owner_userid, perm_type, flag,
                                     groups):
        """
		Sets the permissions on a user's account for albums.

		@param owner_userid: userid of the Owner username
		@type owner_username: Int

		@param perm_type: Type of permission being set (view/comment)
		@type perm_type: String

		@param flag: Permission state - one of (0, 1, 2, 3)
		@type flag: Integer

		@param groups: New group access list, if appropriate
		@type groups: List/tuple
		"""
        try:
            owner_userid = validation.cast_integer(owner_userid,
                                                   'owner_userid')
            validation.oneof(perm_type, ('view', 'comment'), 'perm_type')
            flag = validation.cast_integer(flag, 'flag')
            groups = validation.sequence(groups, 'groups')
        except errors.ValidationError, ex:
            return utils.return_deferred_error(ex.value)
Exemplo n.º 3
0
    def set_account_image_permission(self, userid, perm_type, flag, groups):
        """
		Sets one of the account level image permissions for the specified user.

		@param userid: userid of the User to set permissions for
		@type userid: Int

		@param perm_type: Type of permission being set.	one of (view, tag, comment, print, download, geotag, vote, blog)
		@type perm_type: String

		@param flag: Permission state - one of (0, 1, 2, 3)
		@type flag: Integer

		@param groups: If flag is 2 (private - some contacts), then this is the list of group ids applied.
		@type groups: List or None
		"""
        try:
            userid = validation.cast_integer(userid, 'userid')
            perm_type = validation.string(perm_type)
            flag = validation.cast_integer(flag, 'flag')
            validation.sequence(groups, 'groups')
        except errors.ValidationError, ex:
            return utils.return_deferred_error(ex.value)
Exemplo n.º 4
0
	def set_account_image_permission(self, userid, perm_type, flag, groups):
		"""
		Sets one of the account level image permissions for the specified user.

		@param userid: userid of the User to set permissions for
		@type userid: Int

		@param perm_type: Type of permission being set.	one of (view, tag, comment, print, download, geotag, vote, blog)
		@type perm_type: String

		@param flag: Permission state - one of (0, 1, 2, 3)
		@type flag: Integer

		@param groups: If flag is 2 (private - some contacts), then this is the list of group ids applied.
		@type groups: List or None
		"""
		try:
			userid = validation.cast_integer(userid, 'userid')
			perm_type = validation.string(perm_type)
			flag = validation.cast_integer(flag, 'flag')
			validation.sequence(groups, 'groups')
		except errors.ValidationError, ex:
			return utils.return_deferred_error(ex.value)
Exemplo n.º 5
0
	def set_account_album_permission(self, owner_userid, perm_type, flag, groups):
		"""
		Sets the permissions on a user's account for albums.

		@param owner_userid: userid of the Owner username
		@type owner_username: Int

		@param perm_type: Type of permission being set (view/comment)
		@type perm_type: String

		@param flag: Permission state - one of (0, 1, 2, 3)
		@type flag: Integer

		@param groups: New group access list, if appropriate
		@type groups: List/tuple
		"""
		try:
			owner_userid = validation.cast_integer(owner_userid, 'owner_userid')
			validation.oneof(perm_type, ('view', 'comment'), 'perm_type')
			flag = validation.cast_integer(flag, 'flag')
			groups = validation.sequence(groups, 'groups')
		except errors.ValidationError, ex:
			return utils.return_deferred_error(ex.value)