----- Original Message ----- 
From: Max M <[EMAIL PROTECTED]>
To: Tim Hicks <[EMAIL PROTECTED]>; Zope@Zope. Org <[EMAIL PROTECTED]>
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


_______________________________________________
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )

Reply via email to