Hi all,
Here is the index_html of a product with the index_html embeded in the module source-
def index_html(self,width=100, height=200,RESPONSE=None,REQUEST=None):
"This is the index_html method"
im=PIL.Image.new('RGB', (width,height))
draw = PIL.ImageDraw.Draw(im)
draw.rectangle([0,0,0,0], fill =(0,0,0))
RESPONSE.setHeader("Content-type", "image/gif")
outFile = cStringIO.StringIO()
im.save(outFile, 'gif')
RESPONSE.write(outFile.getvalue())
return ''
If I call an instance of the product from a dtml method with <dtml-var bar> I get my picture.
If I call an instance of the product from a dtml method with <dtml-var bar(100,100)">, I get-
Error Type: AttributeError
Error Value: __call__
Traceback (innermost last):
File C:\Zope\lib\python\ZPublisher\Publish.py, line 150, in publish_module
File C:\Zope\lib\python\ZPublisher\Publish.py, line 114, in publish
File C:\Zope\lib\python\Zope\__init__.py, line 159, in zpublisher_exception_hook
(Object: Zope)
File C:\Zope\lib\python\ZPublisher\Publish.py, line 98, in publish
File C:\Zope\lib\python\ZPublisher\mapply.py, line 88, in mapply
(Object: barcall)
File C:\Zope\lib\python\ZPublisher\Publish.py, line 39, in call_object
(Object: barcall)
File C:\Zope\lib\python\OFS\DTMLMethod.py, line 127, in __call__
(Object: barcall)
File C:\Zope\lib\python\DocumentTemplate\DT_String.py, line 473, in __call__
(Object: barcall)
File C:\Zope\lib\python\DocumentTemplate\DT_Util.py, line 159, in eval
(Object: bar(100,100))
(Info: bar)
File <string>, line 2, in f
AttributeError: (see above)
I have nearly got this product working the way I want it to, so any help you can give will be greatly appreciated.Regards
Sean Kemplay