self.AddStdoutHandler ERROR

Hey guys,
what could cause deadline error when adding
self.AddStdoutHandler( “NAIAD ERROR.*”, self.HandleStdoutError ) to InitializeProcess() function . I’m using Python.NET .

0: An exception occurred: An error occurred while initializing the plugin process: Error in InitializeProcess(): TypeError : No method matches given arguments (Deadline.Plugins.RenderPluginException)

Chunk of code is here

#Python.NET
import clr
#import utilities.path_utility

from System import *
from System.Diagnostics import *
from System.IO import *

from Deadline.Plugins import *
from Deadline.Scripting import *

######################################################################

This is the function that Deadline calls to get an instance of the

main DeadlinePlugin class.

######################################################################
def GetDeadlinePlugin():
return MyPlugin()

######################################################################

This is the main DeadlinePlugin class for the Naiad plugin.

######################################################################
class MyPlugin(DeadlinePlugin):
JobMode = “”
def init( self ):
# Set up the event handlers because this is a Python.NET plugin
self.InitializeProcessEvent += self.InitializeProcess
self.RenderExecutableEvent += self.RenderExecutable
self.RenderArgumentEvent += self.RenderArgument

## Called by Deadline to initialize the process.
def InitializeProcess( self ):
	# Set the plugin specific settings.
	self.SingleFramesOnly = False
	self.PluginType = PluginType.Simple
	
	self.ProcessPriority = ProcessPriorityClass.BelowNormal
	self.UseProcessTree = True
	self.StdoutHandling = True
	
	self.AddStdoutHandler( "NAIAD ERROR.*", self.HandleStdoutError  )
	self.AddStdoutHandler( "Solving frame ([0-9]+)", self.HandleSimProgress )

Thanks

The Python.NET version of the AddStdoutHandler function actually works a bit different, and we just discovered that this isn’t documented anywhere, so we apologize for that! :blush:

Based on your code, your stdout handlers should look like this:

self.AddStdoutHandler( "NAIAD ERROR.*" ).HandleEvent += self.HandleStdoutError
self.AddStdoutHandler( "Solving frame ([0-9]+)" ).HandleEvent += self.HandleSimProgress

We’ve made a note to update the docs to reflect this soon.

Cheers,

  • Ryan

THanks for respond Ryan, when I put 'em under def init( self ): where all my event it gives me this:

0: An exception occurred: An error occurred in function “GetDeadlinePlugin” the plugin script file /home/renderproxy/Deadline/slave/R080/plugins/ToonboxNaiad.py: Python Exception: TypeError : No method matches given arguments (Python.Runtime.PythonException)
Type: <type ‘exceptions.TypeError’>
Value: No method matches given arguments
Stack Trace:
[’ File “none”, line 23, in GetDeadlinePlugin\n’, ’ File “none”, line 35, in init\n’]
(Deadline.Plugins.RenderPluginException)

If I’m just replace them in InitializeProcess() it gives old error that was before? Did I miss something?
I’m using Deadline Version: 5.1.0.46114 and FranticX Version: 2.0.0.46111 could this be an issue?

Code Chunk is:

def __init__( self ):
	# Set up the event handlers because this is a Python.NET plugin
	self.InitializeProcessEvent += self.InitializeProcess	
	self.RenderExecutableEvent += self.RenderExecutable
	self.RenderArgumentEvent += self.RenderArgument	

	
## Called by Deadline to initialize the process.
def InitializeProcess( self ):
	# Set the plugin specific settings.
	self.SingleFramesOnly = False
	self.PluginType = PluginType.Simple
	
	self.ProcessPriority = ProcessPriorityClass.BelowNormal
	self.UseProcessTree = True
	self.StdoutHandling = True
	
	
	self.AddStdoutHandler( "NAIAD ERROR.*" ).HandleEvent += self.HandleStdoutError
	self.AddStdoutHandler( "Solving frame ([0-9]+)" ).HandleEvent += self.HandleSimProgress

Thanks

So sorry! This should work:

self.AddStdoutHandlerEvent( "NAIAD ERROR.*" ).HandleEvent += self.HandleStdoutError
self.AddStdoutHandlerEvent( "Solving frame ([0-9]+)" ).HandleEvent += self.HandleSimProgress

I had the function name wrong.

THanks a lot Ryan, now it works fine.