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


Python Munch.id方法代码示例

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


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

示例1: run

# 需要导入模块: from munch import Munch [as 别名]
# 或者: from munch.Munch import id [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]})
开发者ID:seocam,项目名称:copr,代码行数:35,代码来源:actions.py

示例2: run

# 需要导入模块: from munch import Munch [as 别名]
# 或者: from munch.Munch import id [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]})
开发者ID:domcleal,项目名称:copr,代码行数:46,代码来源:actions.py


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