PipelineFX Forum

Qube! => SimpleCmds => Topic started by: bijuramavfx on November 05, 2012, 08:07:32 PM

Title: cannot get the jobID#
Post by: bijuramavfx on November 05, 2012, 08:07:32 PM
Hi there:

Here is the code that I am trying to run andI am not getting the JobID after the submission

        qubeJob = qb.Job()
        qubeJob['name'] = job.sceneName
        qubeJob['prototype'] = 'cmdrange'
        qubeJob['package'] = {'cmdline' : jobCommandLine,
                              'range'   :   job.frames,
                              'frameCount'  : 5,
                              'renderNode'  : 'Render',
                              'script'      : job.scene,
                              }
        qubeJob['agenda'] = qb.genframes(qubeJob['package']['range'])
        jobId = qb.submit(qubeJob)
        print jobId

I get None ..?

Thanks and much appreciated

/Biju
Title: Re: cannot get the jobID#
Post by: jburk on November 05, 2012, 08:52:36 PM
qb.submit() returns a list, so you should do one of these two approaches:

Code: [Select]
jobId = qb.submit(qubeJob)[0]
    print jobId
or
Code: [Select]
for j in qb.submit(job):
    print '%(name)s: %(id)s' % j

I always use the 2nd form, it also covers the case if I change the script to submit multiple jobs; you just pass the list of jobs to qb.submit like this:
Code: [Select]
for j in qb.submit([jobA, jobB, jobC]):
    print '%(name)s: %(id)s' % j
Title: Re: cannot get the jobID#
Post by: bijuramavfx on November 05, 2012, 09:12:16 PM
thanks jburk like always it works.. :-)