Re: [Zope] External Method Difficulties
Dieter Maurer wrote: > > > That should work. > > What KeyError do you get? > The error message's head should tell you what key has not been > found. The traceback at the foot (especially the last line) > tells you where the KeyError occured. After I posted, I did some more wild, random, send-up-a-prayer hacking and I think I discovered the problem. It appears that the name of the external method and the name of the module file must be the same. At least, I changed the name of the file to genhash.py and things worked. It could be that the file was called md5.py, and since there is a Python module called md5, the interpreter may have been getting confused. I don't know which. Can any one shed some light on that? Thanks for your help, Dieter! -- Jason Lee |Maybe it's good that I can't afford anti-psychotic [EMAIL PROTECTED]|medication. It frees me up to plan the assassination Programmer/Analyst |of Deputy Dawg. -- The Onion ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] External Method Difficulties
Jason Lee writes: > ... external method access ... > > This says, "call the method (for its side effects) but discard any return value". > This produces nothing. I think I read somewhere that dtml-call returns no data, > so that might explain it. I could be wrong. You are right. > That should work. What KeyError do you get? The error message's head should tell you what key has not been found. The traceback at the foot (especially the last line) tells you where the KeyError occured. Dieter ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] External Method Difficulties
For background purposes, I need to write a python module that will generate an MD5 hash of a given string, and return the base 64 representation of that hash. The problem I am facing is getting my stub to work from my DTML document. What I have write now is a stub that takes no arguments and returns "Hello, World". When I click Try It from the management screen, it works fine, but I can't seem to make it work from the DTML doc. This is what Iv'e tried (I'm still pretty new so I'm making wild guesses :) This produces nothing. I think I read somewhere that dtml-call returns no data, so that might explain it. I could be wrong. This produces a KeyError. It seems like I've tried a couple of other manglings, but what they were escapes me for the moment. I'm not passing a parameter right now, cuz I wanted to simplify things once I found out it wasn't going to work like I expected it to. What am I doing wrong? Is there a better place to start than this list? I have the content manager's guide and the dtml reference, but I can't find anything helpful. The ID for the external method is md5 in case that helps. Thanks a lot! -- Jason Lee - Programmer/Analyst The Fox and the Grapes: I'm not sure what the point is here. The moral is "It is easy to despise what you cannot get," but from experience I can tell you it's easy to despise what you do get as well, especially in terms of cable channels. -- The Brunching Shuttlecocks ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )