Hey!
I’m looking at the ModifyCommandLineCallback
to Alter the Commandline.
https://docs.thinkboxsoftware.com/products/deadline/9.0/1_User%20Manual/manual/application-plugins.html#modify-cmd-line
Is there a way to fetch the job Object from the AlterCommandline
function from the documentation above? I have JobExtraInfoKeyValue I would need to fetch that is important for the Commandline.
Any Ideas?
We create a global var to store a reference to the job.
deadlinePluginReference = None
then reference that var
def AlterCommandLine( executable, arguments, workingDirectory ):
global deadlinePluginReference
…
job = deadlinePluginReference.GetJob()
key = “ExtraInfoKeyValue0”
val = job.GetJobInfoKeyValue(key)
The variable is set in the main of the GlobalJobPreLoad.py
def main( deadlinePlugin ):
global deadlinePluginReference
deadlinePlugin.DebugLogging = True # optional, can be commented out
deadlinePlugin.ModifyCommandLineCallback += AlterCommandLine
deadlinePluginReference = deadlinePlugin
Thinking about it a little more, you could make a cleaner implementation with a lambda and adding the plugin as a parameter to AlterCommandLine.