本文整理汇总了Python中munch.Munch.job_ended_on方法的典型用法代码示例。如果您正苦于以下问题:Python Munch.job_ended_on方法的具体用法?Python Munch.job_ended_on怎么用?Python Munch.job_ended_on使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类munch.Munch
的用法示例。
在下文中一共展示了Munch.job_ended_on方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: run
# 需要导入模块: from munch import Munch [as 别名]
# 或者: from munch.Munch import job_ended_on [as 别名]
def run(self):
""" Handle action (other then builds) - like rename or delete of project """
result = Munch()
result.id = self.data["id"]
action_type = self.data["action_type"]
if action_type == ActionType.DELETE:
if self.data["object_type"] == "copr":
self.handle_delete_copr_project()
elif self.data["object_type"] == "build":
self.handle_delete_build()
result.result = ActionResult.SUCCESS
elif action_type == ActionType.LEGAL_FLAG:
self.handle_legal_flag()
elif action_type == ActionType.RENAME:
self.handle_rename(result)
elif action_type == ActionType.CREATEREPO:
self.handle_createrepo(result)
elif action_type == ActionType.UPDATE_COMPS:
self.handle_comps_update(result)
if "result" in result:
if result.result == ActionResult.SUCCESS and \
not getattr(result, "job_ended_on", None):
result.job_ended_on = time.time()
self.frontend_client.update({"actions": [result]})
示例2: run
# 需要导入模块: from munch import Munch [as 别名]
# 或者: from munch.Munch import job_ended_on [as 别名]
def run(self):
""" Handle action (other then builds) - like rename or delete of project """
result = Munch()
result.id = self.data["id"]
action_type = self.data["action_type"]
if action_type == ActionType.DELETE:
if self.data["object_type"] == "copr":
self.handle_delete_copr_project()
elif self.data["object_type"] == "build":
self.handle_delete_build()
result.result = ActionResult.SUCCESS
elif action_type == ActionType.LEGAL_FLAG:
self.handle_legal_flag()
elif action_type == ActionType.RENAME:
self.handle_rename(result)
elif action_type == ActionType.FORK:
self.handle_fork(result)
elif action_type == ActionType.CREATEREPO:
self.handle_createrepo(result)
elif action_type == ActionType.UPDATE_COMPS:
self.handle_comps_update(result)
elif action_type == ActionType.GEN_GPG_KEY:
self.handle_generate_gpg_key(result)
elif action_type == ActionType.RAWHIDE_TO_RELEASE:
self.handle_rawhide_to_release(result)
self.log.info("Action result: {}".format(result))
if "result" in result:
if result.result == ActionResult.SUCCESS and \
not getattr(result, "job_ended_on", None):
result.job_ended_on = time.time()
self.frontend_client.update({"actions": [result]})