TypeError: __call__() takes exactly 2 argument
Posted: Mon Oct 14, 2013 11:51 am
Hi.
I am trying to make a plugin but get an error when trying to use a configurable value from the plugin in an action. Have tried from scratch using the examle from the documentation but get the same error. How should the code look?
My plugin looks like this from the example in the documentation:
Have also tryed "print self.myString" and "print self.plugin.myString" instead of "print mystring" but get the same error.
Hope someone can help me get on the right track.
Regards Jostein
I am trying to make a plugin but get an error when trying to use a configurable value from the plugin in an action. Have tried from scratch using the examle from the documentation but get the same error. How should the code look?
Code: Select all
13:39:41 Error in Action: "My New Plugin: PrintString"
13:39:41 Traceback (most recent call last) (1630):
13:39:41 File "C:\Program Files (x86)\EventGhost\eg\Classes\ActionBase.py", line 170, in CallWrapper
13:39:41 return self(*args)
13:39:41 TypeError: __call__() takes exactly 2 arguments (1 given)Code: Select all
import eg
eg.RegisterPlugin(
name = "My New Plugin",
author = "Me",
version = "0.0.1",
kind = "other",
description = "This is an example plugin."
)
class MyNewPlugin(eg.PluginBase):
def __init__(self):
self.AddAction(PrintString)
def Configure(self, myString=""):
panel = eg.ConfigPanel()
textControl = wx.TextCtrl(panel, -1, myString)
panel.sizer.Add(textControl, 1, wx.EXPAND)
while panel.Affirmed():
panel.SetResult(textControl.GetValue())
class PrintString(eg.ActionBase):
def __call__(self, myString):
print myStringHope someone can help me get on the right track.
Regards Jostein