[Zope] First External Method

Ben Ocean beno@thewebsons.com
Tue, 23 Oct 2001 05:59:22 -0700


Hi;
Here is my very_simple external method. It is called sizeCalc
 >>>
def sizeCalc(x,y):
  print x*y
<<<
I have imported the external python method. I call it in a script with this 
line:
<img src="images/top" width=<dtml-var sizeCalc(1008,<dtml-var size>)> 
height=<dtml-var sizeCalc(82,<dtml-var size>)> alt="">
Yes, <dtml-var size> is defined. I get the following errors:

Traceback (innermost last):
   File 
/apache/ZopeInstallation/Zope_software_home/lib/python/ZPublisher/Publish.py, 
line 223, in publish_module
   File 
/apache/ZopeInstallation/Zope_software_home/lib/python/ZPublisher/Publish.py, 
line 187, in publish
   File 
/apache/ZopeInstallation/Zope_software_home/lib/python/Zope/__init__.py, 
line 226, in zpublisher_exception_hook
     (Object: LockableItem)
   File 
/apache/ZopeInstallation/Zope_software_home/lib/python/ZPublisher/Publish.py, 
line 171, in publish
   File 
/apache/ZopeInstallation/Zope_software_home/lib/python/ZPublisher/mapply.py, 
line 160, in mapply
     (Object: index_html)
   File 
/apache/ZopeInstallation/Zope_software_home/lib/python/ZPublisher/Publish.py, 
line 112, in call_object
     (Object: index_html)
   File 
/apache/ZopeInstallation/Zope_software_home/lib/python/OFS/DTMLDocument.py, 
line 199, in __call__
     (Object: index_html)
   File 
/apache/ZopeInstallation/Zope_software_home/lib/python/DocumentTemplate/DT_String.py, 
line 546, in __call__
     (Object: index_html)
   File 
/apache/ZopeInstallation/Zope_software_home/lib/python/OFS/DTMLMethod.py, 
line 187, in __call__
     (Object: template)
   File 
/apache/ZopeInstallation/Zope_software_home/lib/python/DocumentTemplate/DT_String.py, 
line 546, in __call__
     (Object: template)
   File 
/apache/ZopeInstallation/Zope_software_home/lib/python/DocumentTemplate/DT_Var.py, 
line 278, in render
     (Object: sizeCalc(1008,<dtml-var)
KeyError: (see above)

Please help me see my (no doubt very obvious) error.
TIA,
BenO