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


Python Job.mailto方法代码示例

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


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

示例1: add_job

# 需要导入模块: from Job import Job [as 别名]
# 或者: from Job.Job import mailto [as 别名]
    def add_job(self, name, version, priority, dist, mailto=None, arch=None):
        """Add a job"""

        if not arch:
            arch = self.cfg.arch[0]

        if not Dists().get_dist(dist, arch):
            RebuilddLog.error("Couldn't find dist/arch in the config file for %s_%s on %s/%s, don't adding it" \
                           % (name, version, dist, arch))
            return False

        pkgs = Package.selectBy(name=name, version=version)
        if pkgs.count():
            # If several packages exists, just take the first
            pkg = pkgs[0]
        else:
            # Maybe we found no packages, so create a brand new one!
            pkg = Package(name=name, version=version, priority=priority)

        jobs_count = Job.selectBy(package=pkg, dist=dist, arch=arch, mailto=mailto, status=JobStatus.WAIT).count()
        if jobs_count:
            RebuilddLog.error("Job already existing for %s_%s on %s/%s, don't adding it" \
                           % (pkg.name, pkg.version, dist, arch))
            return False

        job = Job(package=pkg, dist=dist, arch=arch)
        job.status = JobStatus.WAIT
        job.arch = arch
        job.mailto = mailto

        log = Log(job=job)

        RebuilddLog.info("Added job for %s_%s on %s/%s for %s" \
                      % (name, version, dist, arch, mailto))
        return True
开发者ID:kryskool,项目名称:rebuildd,代码行数:37,代码来源:Rebuildd.py


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