Пример #1
0
    # --
    wrapper.add_sub_job(j)
    # ==
    j = JobNode(id='fob', desc=''' fob ''')
    j.set_callback(fob_job)
    wrapper.add_sub_job(j)
    '''
    everything looks good in dry run mode.
    turn it off to test in real mode
    '''
    wrapper.set_dry_run(False)
    '''
    after several round of testing, i found most jobs work fine.
    but there's something strange in the second job. so I want to enable the
    real mode only for that job. then, we could set dry_run for indivisual job.
    however, the dry_run config is a global setting; once you set for any job,
    it will affect on the whole process. to specify the scope on the certain job,
    you need to set the config locally by set_as_local parameter.

    wait. there is another trick in the config: the sub jobs of a JobBlock will
    inherit the config from its parent. so you could limit the scope of real mode
    step by step to testing the ill job.
    '''
    wrapper.set_dry_run(True)
    j = wrapper.find_job('block')
    j.set_dry_run(False, set_as_local=True)

    # ==
    job_id, state = wrapper.execute()
    #raw_input()
Пример #2
0
    j = JobNode(id='fob', desc=''' fob ''')
    j.set_callback(fob_job)
    wrapper.add_sub_job(j)

    '''
    everything looks good in dry run mode.
    turn it off to test in real mode
    '''
    wrapper.set_dry_run(False)

    '''
    after several round of testing, i found most jobs work fine.
    but there's something strange in the second job. so I want to enable the
    real mode only for that job. then, we could set dry_run for indivisual job.
    however, the dry_run config is a global setting; once you set for any job,
    it will affect on the whole process. to specify the scope on the certain job,
    you need to set the config locally by set_as_local parameter.

    wait. there is another trick in the config: the sub jobs of a JobBlock will
    inherit the config from its parent. so you could limit the scope of real mode
    step by step to testing the ill job.
    '''
    wrapper.set_dry_run(True)
    j = wrapper.find_job('block')
    j.set_dry_run(False, set_as_local=True)


    # ==
    job_id, state = wrapper.execute()
    #raw_input()