[Zope] getting contents of file into a variable

Dieter Maurer dieter@handshake.de
Sat, 7 Sep 2002 20:19:23 +0200


You subject seems not to have anything to do with your problem report...

=?ISO-8859-1?Q?Bj=F8rge_Solli?= writes:
 > I try this way:
 > <dtml-let shovedid="SEMESTERID_HOVED" hovedid="str2int(shovedid)">
 > where SEMESTERID_HOVED contains one line of integers (20021).
 > str2int is an external python script just returning the int-cast of
 > whatever string it gets in.

Here you should have reported the "Error Type" and "Error Value", you
see in the error report!

 > Traceback (innermost last):
 > ...
 
 > 231, in eval
 >     (Object: str2int(shovedid))
 >     (Info: shovedid)
 >   File &lt;string&gt;, line 2, in f
 >   File
 > /export/space/Zope/Zope-2.4.x/lib/python/Products/ExternalMethod/ExternalMethod.py,
 > line 274, in __call__
 >     (Object: str2int)
 >     (Info: ((&lt;DTMLMethod instance at 16eed80&gt;,), {}, None))
 >   File /export/space/Zope/zope/Extensions/str2int.py, line 2, in str2int
 >     (Object: SEMESTERID_HOVED)
 > AttributeError: (see above)
You successfully called your External Method "str2int".
In line 2 it tries to access an attribute which is not there.
"Error Value" tells you its name...


Dieter