I hope this is simple. I’d like to pull the user name (e.g. SubmitUserName from the .job file) in an OnJobStarted Event plug-in. I’ve found many ways not to do this, marching through the scripting functions that had “user” in their name, with the end result being some variant of " has no attribute ". I’m not a programmer, so I suspect either I’m missing a very basic concept here about Python, or a very basic concept about Deadline (e.g. you can’t do this in an Event context). Is there a way to get this?
You just need to return the job object:
[code]from Deadline.Events import *
def GetDeadlineEventListener():
return ExampleEventListener()
class ExampleEventListener ( DeadlineEventListener ):
def OnJobStarted( self, job ):
username = job.JobUserName[/code]
Thanks a lot. I don’t know how I didn’t try what looks to be the basic way to do this but it works fine now. Much appreciated.