Accessing self in External Methods
Hi, I am using an external method to call wvWare and catalog a M$-Word file content. The file object is an attribute of my ZClass. The external method is called by a Python Script (PrincipiaSearchSource). I´d like to know how can I access the file atribute from the external method. I tryed directly: self.file, but it didn´t work. Does that mean ZClasses atributes are always private? How can I get this file object? Using getattr? One more question: how can I modify a class attribute inside the External Method? thanks, Rogerio
ratem@censa.com.br writes:
I am using an external method to call wvWare and catalog a M$-Word file content.
The file object is an attribute of my ZClass. The external method is called by a Python Script (PrincipiaSearchSource). Then your Python Script should explicitly pass "context" into your External Method. There, you can access it instances in the normal way.
There is a magic passing of the context of the External Method as the first argument, if it is called "self" and the method is called with precisely one argument less than the required number of arguments. As you see, the rule is that strange, that you should use it only when you really need to. There is no need in a Python Script... Dieter
participants (2)
-
Dieter Maurer -
ratem@censa.com.br