I want to use an eventscript and send the jobID and a string to a c# server via a socket. Anyone ever done this before with deadline?
###############################################################
Imports
###############################################################
from System.Diagnostics import *
from System.IO import *
from System import TimeSpan
from Deadline.Events import *
from Deadline.Scripting import *
import re, sys, os
import socket
###############################################################
This is the function called by Deadline to get an instance of the Salt event listener.
###############################################################
def GetDeadlineEventListener():
return MyEventListener()
def CleanupDeadlineEventListener( eventListener ):
eventListener.Cleanup()
###############################################################
The Salt event listener class.
###############################################################
class MynEventListener (DeadlineEventListener):
def init( self ):
# Set up the event callbacks here
self.OnJobSubmittedCallback += self.OnJobSubmitted
self.OnJobStartedCallback += self.OnJobStarted
self.OnJobErrorCallback += self.OnJobError
self.OnJobFailedCallback += self.OnJobFailed
self.OnJobFinishedCallback += self.OnJobFinished
def Cleanup( self ):
del self.OnJobSubmittedCallback
del self.OnJobFinishedCallback
def OnJobSubmitted( self, job ):
# TODO: Connect to pipeline site to notify it that a job has been submitted
# for a particular shot or task.
if Jobs.Job.JobUserName != "developer"
return None
else:
##send jobID and status "submitted" to server@socket
## Connect to server and send data
def OnJobStarted( self, job ):
# TODO: Connect to pipeline site to notify it that a job has been started
# for aparticular shot or task.
pass
def OnJobError( self, job ):
# TODO: Connect to pipeline site to notify it that a job failed
# for a particular shot or task.
pass
def OnJobFailed( self, job ):
# TODO: Connect to pipeline site to notify it that a job failed
# for a particular shot or task.
pass
def OnJobFinished( self, job ):
# TODO: Connect to pipeline site to notify it that the job for a particular
# shot or task is complete.
pass