Hi! Is it possible to write a standard_error_message as a method in a python product? "def standard_error_message(self, **kwargs)" --> this does not work. I get: An Error occured while displaying the error message ... I don't get it working, according to the collector it should be working with 2.6.0 Version: (Zope 2.6.0 (source release, python 2.1, linux2), python 2.1.3, linux2) thomas -- Thomas Guettler <guettli@thomas-guettler.de> http://www.thomas-guettler.de
Thomas Guettler wrote:
Hi!
Is it possible to write a standard_error_message as a method in a python product?
probably
"def standard_error_message(self, **kwargs)"
...that doesn't look like a good set of parameters. Use whatever parameters a ZPT takes when called (look in ZopePageTemplate.py for a __call__ method) and emulate that. Also make sure your method is anonymously accessible and doesn't error. cheers, Chris
Thomas Guettler writes:
Is it possible to write a standard_error_message as a method in a python product?
"def standard_error_message(self, **kwargs)" Try: def standard_error_message(self, client=None, REQUEST=None, **kwargs):
Dieter
On Mon, Nov 25, 2002 at 07:32:03PM +0100, Dieter Maurer wrote:
Thomas Guettler writes:
Is it possible to write a standard_error_message as a method in a python product?
"def standard_error_message(self, **kwargs)" Try: def standard_error_message(self, client=None, REQUEST=None, **kwargs):
I tried it with several combinations. Since client and REQUEST are keywordarguments, the two ways should be the same. The standard_error_message can be accessed with foo_url/standard_error_message: def standard_error_message(self, client=None, REQUEST=None, **kwargs): "docstring" return "ERROR" Maybe the following collector issue is still not solved: http://collector.zope.org/Zope/69/view thomas -- Thomas Guettler <guettli@thomas-guettler.de> http://www.thomas-guettler.de
Thomas Guettler writes:
On Mon, Nov 25, 2002 at 07:32:03PM +0100, Dieter Maurer wrote:
Thomas Guettler writes:
Is it possible to write a standard_error_message as a method in a python product?
"def standard_error_message(self, **kwargs)" Try: def standard_error_message(self, client=None, REQUEST=None, **kwargs):
I tried it with several combinations. Since client and REQUEST are keywordarguments, the two ways should be the same. They are not ;-)
With the second definition, "standard_error_message" can be called like "standard_error_message(client,REQUEST)"; with the first one, you will get a TypeError. Dieter
On Tue, Nov 26, 2002 at 06:57:38PM +0100, Dieter Maurer wrote:
Thomas Guettler writes:
On Mon, Nov 25, 2002 at 07:32:03PM +0100, Dieter Maurer wrote:
Thomas Guettler writes:
Is it possible to write a standard_error_message as a method in a python product?
"def standard_error_message(self, **kwargs)" Try: def standard_error_message(self, client=None, REQUEST=None, **kwargs):
I tried it with several combinations. Since client and REQUEST are keywordarguments, the two ways should be the same. They are not ;-)
With the second definition, "standard_error_message" can be called like "standard_error_message(client,REQUEST)"; with the first one, you will get a TypeError.
Yes, you are right. It is not the same. But I tried the following, too: def standard_error_message(self, *args, **kwargs) which didn't work. But it is not very important, i was just curious. Nevertheless thank you for your suggestion. thomas -- Thomas Guettler <guettli@thomas-guettler.de> http://www.thomas-guettler.de
Thomas Guettler wrote:
Yes, you are right. It is not the same. But I tried the following, too:
def standard_error_message(self, *args, **kwargs)
which didn't work. But it is not very important, i was just curious. Nevertheless thank you for your suggestion.
There's a thing in Zope (I think called 'mapply') that snfifs the signature adn tries to provide he right parameters. it's sniffing fails with the above declaration. cheers, Chris
I'm using: from Globals import DTMLFile Standard_error_message=DTMLFile("dtml/standard_error_message", globals()) Which is tickety-boo (that's British English for works fine) A On 25/11/02 1:29 pm, "Thomas Guettler" <guettli@thomas-guettler.de> wrote:
Hi!
Is it possible to write a standard_error_message as a method in a python product?
"def standard_error_message(self, **kwargs)"
--> this does not work. I get: An Error occured while displaying the error message ...
I don't get it working, according to the collector it should be working with 2.6.0
Version: (Zope 2.6.0 (source release, python 2.1, linux2), python 2.1.3, linux2)
thomas
On 13/12/02 12:29 am, "Andrew Veitch" <andrew@logicalprogression.net> wrote:
I'm using:
from Globals import DTMLFile
Standard_error_message=DTMLFile("dtml/standard_error_message", globals())
That should of course be with a lower case 's' in standard_error_message, I'm afraid my mail client automatically changed it into a capital letter because it was at the start of a sentence. A
participants (4)
-
Andrew Veitch -
Chris Withers -
Dieter Maurer -
Thomas Guettler