[Zope] Getting slashdot to work...

Tony McDonald tony.mcdonald@ncl.ac.uk
Fri, 12 Mar 1999 14:00:07 +0000


HI all,
In my quest to figure out how Zope works, I'm starting with ExtrenalMethods.

I've moved slashdot.py into Extensions and set up an external method 
(id: get_headlines, funstion name: get_headlines, python module: 
slashdot).

My 'calling' DTML is a method (slashdot_headlines) with the following;
<!--#call get_headlines-->        
<!--#in headlines mapping-->
<p>
<a href="<!--#var href-->"><!--#var title--></a>
</p>
<!--#/in-->             
trying 'view' on this method gives the following;
<!--
 Error type: 
 Error value: read-only buffer, class
 -->
...
<!--
Traceback (innermost last):
  File lib/python/ZPublisher/Publish.py, line 877, in publish_module
  File lib/python/ZPublisher/Publish.py, line 590, in publish
    (Info: /wip/slashdot_headlines)
  File lib/python/OFS/DTMLMethod.py, line 155, in __call__
    (Object: slashdot_headlines)
  File lib/python/OFS/DTMLMethod.py, line 151, in __call__
    (Object: slashdot_headlines)
  File lib/python/DocumentTemplate/DT_String.py, line 513, in __call__
    (Object: slashdot_headlines)
  File lib/python/Products/ExternalMethod/ExternalMethod.py, line 
254, in __call__
    (Object: CopySource)
    (Info: ((), {}, ('headlines', 'headlines_date', 60)))
TypeError: (see above)

-->

I *did* have a problem with using a proxy, but got around that by 
adding this line to slashdot.py (just before the urllib.urlopen() 
call).
urllib.URLopener(proxies={'http': 'http://cache-box.you.domain:your_port'})

What am I doing wrong?
many thanks
tone

------
Dr Tony McDonald,  FMCC, Networked Learning Environments Project
The Medical School, Newcastle University Tel: +44 191 222 5888
Fingerprint: 3450 876D FA41 B926 D3DD  F8C3 F2D0 C3B9 8B38 18A2