Hi,
Are the Extra Info Key/Value Pairs for jobs exposed to the event plugins?
I’m using the OverrideJobName example to change job properties, but have only found reference to JobExtraInfo0-9 in the scripting guide.
I want to be able to force in some quick draft options once the job has been submitted to the Deadline queue.
Thanks.
Here you go (assuming you have first obtained the job object):
Job.GetJobExtraInfoKeys()
docs.thinkboxsoftware.com/produ … 5f238de049
Job.GetJobExtraInfoKeyValue( key )
docs.thinkboxsoftware.com/produ … a865a759d5
Jumping in on this:
How does one get any information based on the job itself inside events? I have the job as an argument in the callback, but I get errors when accessing its methods:
def OnJobFinished( self, job ):
self.LogInfo("Job finished!")
# ^ prints just fine, so the event is properly triggering.
self.LogInfo("Job argument is type %s" % type(job))
# INFO: Job argument is type <class 'Deadline.Jobs.Job'> (also prints just fine, so it's found it's class)
self.LogInfo(job.JobId)
# INFO: 596cf17fc0854163063b9e9f
self.LogInfo(job.GetJobEnvironmentKeys())
# TypeError : No method matches given arguments
pass
The above is from a custom event I’ve built based on examples from Deadline documentation. As shown in the commented lines above, these are the returns for each line. Based on this page, I should be able to access that object and grab its properties. Why do I get the “No method matches given arguments” error? Especially since I can grab those properties just fine?
Here’s the entire code:
[code]from Deadline.Events import *
######################################################################
This is the function that Deadline calls to get an instance of the
main DeadlineEventListener class.
######################################################################
def GetDeadlineEventListener():
return MpsEvent()
######################################################################
This is the function that Deadline calls when the event plugin is
no longer in use so that it can get cleaned up.
######################################################################
def CleanupDeadlineEventListener( deadlinePlugin ):
deadlinePlugin.Cleanup()
######################################################################
This is the main DeadlineEventListener class for MyEvent.
######################################################################
class MpsEvent (DeadlineEventListener):
def __init__( self ):
# Set up the event callbacks here
self.OnJobFinishedCallback += self.OnJobFinished
def Cleanup( self ):
del self.OnJobFinishedCallback
def OnJobFinished( self, job ):
# TODO: Connect to pipeline site to notify it that the job for a particular
# shot or task is complete.
self.LogInfo("Job finished!")
self.LogInfo("Job argument is type %s" % type(job))
# INFO: Job argument is type <class 'Deadline.Jobs.Job'>
self.LogInfo(job.JobId)
# INFO: 596d0135c0854163063b9ea2
self.LogInfo(job.GetJobEnvironmentKeys())
# TypeError : No method matches given arguments
pass[/code]
Sorry, nevermind, figured that out. it was the self.LogInfo function throwing the error, not the Job class. It didn’t know how to handle a list.
Thanks, all.