AWS Thinkbox Discussion Forums

script dependencies __main__() error

Hi there,

I am customizing some dependency handling, and have added a new dependency handler script. It was based on the existing one we have, but for some odd reason, this one fails with the following error:

2013-11-05 11:46:01:  Error running dependency script: /mnt/s2/exchange/software/managed/deadline/scriptDependency/scriptDependencyTest.py
2013-11-05 11:46:01:  Python Error: TypeError : __main__() takes exactly 2 arguments (1 given) (Python.Runtime.PythonException)
2013-11-05 11:46:01:  Stack Trace:
2013-11-05 11:46:01:   (System.Exception)
2013-11-05 11:46:01:    at FranticX.Scripting.PythonNetScriptEngine.HandlePythonError (System.Exception e) [0x00000] in <filename unknown>:0
2013-11-05 11:46:01:    at FranticX.Scripting.PythonNetScriptEngine.CallFunction (System.String functionName, Python.Runtime.PyObject[] args) [0x00000] in <filename unknown>:0
2013-11-05 11:46:01:    at Deadline.Scripting.DeadlineScriptEngine.CallFunction (System.String functionName, Python.Runtime.PyObject[] args) [0x00000] in <filename unknown>:0
2013-11-05 11:46:01:    at Deadline.Scripting.DeadlineScriptManager.CallFunction (System.String scopeName, System.String functionName, Python.Runtime.PyObject[] args) [0x00000] in <filename unknown>:0
2013-11-05 11:46:01:    at Deadline.Controllers.DataController.DependentJobCanStart (Deadline.Jobs.Job job, Deadline.Jobs.Job[] dependentJobs, Boolean verbose) [0x00000] in <filename unknown>:0

The script looks like this:

__version__ = "v0.21TEST"

from Deadline.Scripting import *
import os
import xml.etree.ElementTree as xml
import glob
import re

ClientUtils.LogText("-Running Test Dependency Handler TEST2-")
def __main__(sJobID, vTaskIDs):
    ClientUtils.LogText("-Main Called TEST-")
    return []

The main function of the script that DOES work looks like this:

def __main__(sJobID, vTaskIDs):

I see no difference?

The job didnt have ‘frame dependencies’ turned on… nevermind

We’re updating the documentation to show how you could write a script to work in both situations. Basically, you define a main function like this:

def __main__( jobId, taskIds=None):

Then you can check if taskIds is set to None, and if it is, you know that frame dependencies are disabled.

Privacy | Site terms | Cookie preferences