[Zope] dtml-in over the output from my method
Tim Hicks
tim.hicks@iname.com
Tue, 7 Nov 2000 01:11:34 -0000
----- Original Message -----
From: Max M <maxmcorp@worldonline.dk>
To: Tim Hicks <tim.hicks@iname.com>; Zope@Zope. Org <zope@zope.org>
Sent: Monday, November 06, 2000 9:48 PM
Subject: RE: [Zope] dtml-in over the output from my method
<snip>
>
> def list_messages(self):
>
> class msg:
> def __init__(self, msgnum, msgfrom, msgsub):
> self.msgnum = msgnum
> self.msgfrom = msgfrom
> self.msgsub = msgsub
>
> msgList = []
> lr = open(self.user_dir+'/msg_list', 'r')
> spl = re.compile('\s\|\s')
> for msg_line in lr.readline():
> num_from_sub = []
> num_from_sub = spl.split(msg_line, 2)
>
> # Oh no ... this wont cut it!
> #self.msgnum = num_from_sub[0]
> #self.msgfrom = 'This is from UNKNOWN'
> #self.msgsub = 'My special subject'
> #return self.msgnum, self.msgfrom, self.msgsub
>
> # Do it like this:
> msgList.append(msg(num_from_sub[0],'This is from UNKNOWN',
> 'My special subject'))
> return msgList
>
>
Brilliant, it works a treat. Thanks very much.
tim