当前位置: 首页>>代码示例>>Python>>正文


Python Job.start_packaging方法代码示例

本文整理汇总了Python中models.Job.start_packaging方法的典型用法代码示例。如果您正苦于以下问题:Python Job.start_packaging方法的具体用法?Python Job.start_packaging怎么用?Python Job.start_packaging使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在models.Job的用法示例。


在下文中一共展示了Job.start_packaging方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: process_medias

# 需要导入模块: from models import Job [as 别名]
# 或者: from models.Job import start_packaging [as 别名]
def process_medias():
	# find the job which is being processed
	job_id = request.form['job_id']
	job = _get_job(job_id)

	pprint.pprint('========= BACKGROUND PROCESSING ')

	# gets the watermark image
	watermark = ih.get_watermark_image()

	photo_list = []
	# iterates over each photo
	for p in job.medias['photos']:
		new_url = _process_media(p, watermark, job_id)
		photo_list.append({
				'title': p['title'],
				'url': new_url,
				'media_id': p['media_id']
			})

	job.medias['photos'] = photo_list


	if job.status == 'ASSIGNED':
		# send a message to property owner telling him that his job is ready for approval
		_enqueue_job_in_approval_message(job)

		create_activity('JOB_PUBLISHING_DONE', job=job)
	elif job.status == 'REDO':
		_enqueue_job_back_from_redo_message(job)

		create_activity('JOB_PUBLISHING_REDO_DONE', job=job)

	job.status = 'REVIEW'
	job.put()


	Job.start_packaging(job_id)

	return '', 200
开发者ID:armandomiani,项目名称:flask-appengine-bootstrap,代码行数:42,代码来源:jobs.py


注:本文中的models.Job.start_packaging方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。