AWS Thinkbox Discussion Forums

Requeueing and deleting jobs on complete through Python

Hey guys,

I run comp in Cartoon Saloon in Ireland and in the new year we’re going to be hiring a Python scripter to help us customize things to fit our workflow. I have no scripting experience, so before I write up a list of adaptations I need, I wanted to run my ideas past you guys to confirm that they should be workable.

I’ll just run two small ones by you to give you an idea:

  1. The Draft jobs that are created automatically when using the (Deadline 7) create/upload movie and film strip to Shotgun function; we’d like if they could either delete or archive automatically on completion. I know basically every submitter has an ‘On Job Complete’ option so I figure python can grab that somewhere right?

  2. The CreateShotgunVersion script that’s bundled with Deadline (a fantastic little script); would it be possible for us to adapt that script to pin a little ‘Requeue Job’ command at the end of it? So it creates a new Shotgun Version, and then requeues the job. That shouldn’t be too difficult right?

Excuse my ignorance on this stuff, I’m completely script illiterate!

Thanks!

Mark

Hey Mark,

  1. You would just need to edit the Draft.py file in \your\repository\events\Draft. Find this line:
fileHandle.write( "OnJobComplete=%s\n" % job.JobOnJobComplete )

and change it to this:

fileHandle.write( "OnJobComplete=Delete\n" )

Currently, we set it to whatever the original job is set to. The new code simply forces it to always delete on complete.

  1. Yup, this is also possible. You would just need to edit CreateShotgunVersion.py in \your\repository\scripts\Jobs. Find this line:
RepositoryUtils.SaveJob( job )

Then add the following line right after it:

RepositoryUtils.RequeueJob( job )

Cheers,
Ryan

This worked PERFECTLY, Ryan.

Thanks so much, we were only looking to gauge if these adjustments were plausible. I didn’t realize we could make them that quick!

M

Privacy | Site terms | Cookie preferences