[Zope] Zope changing incoming info?

Gary Perez garyp@asti-usa.com
Wed, 28 Feb 2001 11:27:32 -0500


Hi, all.

Zope 2.2.2, Python 1.5.2, Linux 2.4.1

Got an python module (/opt/Zope/Extensions/selfInfo.py) which returns a dictionary.
Got a Zope external method "Get_Self_Info" w/ appropriate function/filename.

Now... when calling from either a DTML Document or DTML Method,
something's going screwy.

### CALL 1 ###
<dtml-var Get_Self_Info>
returns
	{'cpuLoading': 16.4179104478}
Beautiful, no?

### CALL 2 ###
<dtml-var "Get_Self_Info['cpuLoading']">
barfs, returns
	Error Type: AttributeError
	Error Value: __getitem__
	...
	File /opt/Zope/lib/python/DocumentTemplate/DT_Util.py, line 337, in eval
		(Object: Get_Self_Info['cpuLoading'])
		(Info: Get_Self_Info)
	File <string>, line 0, in ?
	File /opt/Zope/lib/python/DocumentTemplate/DT_Util.py, line 163, in careful_getitem

I'm used to accounting for this error... usually by calling like in CALL 3...

### CALL 3 ###
<dtml-let XYZ=Get_Self_Info>
<dtml-var "XYZ['cpuLoading']">
</dtml-let>
returns
	{'cpuLoading': 100.0}

My question is... why is Zope returning the correct float the first time
(CALL 1), but returning an entirely different float for CALL 3?

Is there something I'm missing?

Thanks in advance for your help.
-Gary

-- 
Gary Perez, (insert job title of choice)
Mktg. Coord. + MIS Mgr. + Sys. Admin.
Advanced Simulation Technology, inc.
http://www.asti-usa.com/