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


Python Job.setExecution方法代码示例

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


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

示例1: endElement

# 需要导入模块: from job import Job [as 别名]
# 或者: from job.Job import setExecution [as 别名]
    def endElement(self, name):
        attributes = self.attributesList.pop()

        if name == "job":
            # build job
            job = Job(self.recipeRef)
            executionType     = attributes[u"type"]
            executionTime    = util.parseTime(attributes[u"time"])
            executionDay    = ""
            if (not executionType == "daily"):
                executionDay = attributes[u"day"]

            job.setExecution(executionType, executionTime, executionDay)
            self.jobs.append(job)

        if name == "recipeRef":
            self.recipeRef = self.buffer

        self.buffer = ""
开发者ID:baumartig,项目名称:paperboy,代码行数:21,代码来源:xml_jobs_handler.py

示例2: testDaily

# 需要导入模块: from job import Job [as 别名]
# 或者: from job.Job import setExecution [as 别名]
def testDaily():
    print "TEST Daily"
    job = Job("testRef")
    now = datetime(2014, 2, 2, 10)

    # execute later
    addition = timedelta(hours=1)
    job.setExecution("daily", (now + addition).time())

    calculateNextExecution(job, now)
    assert datetime(2014, 2, 2, 11) == job.nextExecution, "Calculated wrong execution date: %s"\
                                                           % str(job.nextExecution)

    # execute tomorrow
    addition = timedelta(hours=-1)
    job.setExecution("daily", (now + addition).time())

    calculateNextExecution(job, now)
    assert datetime(2014, 2, 3, 9) == job.nextExecution, "Calculated wrong execution date: %s"\
                                                          % str(job.nextExecution)
    print "OK"
开发者ID:baumartig,项目名称:paperboy,代码行数:23,代码来源:executiontime_calculator.py


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