Re: MaildirMessage

2007-07-14 Thread Ben Finney
Steve Holden <[EMAIL PROTECTED]> writes: > What do you actually think > > for m in msg: > print m > > should do? Why do you believe that what you think it should do would > be a natural choice? I think it odd for a Message to support the mapping protocol. However, since

Re: MaildirMessage

2007-07-14 Thread Gabriel Genellina
En Sat, 14 Jul 2007 06:26:43 -0300, Tzury <[EMAIL PROTECTED]> escribió: >> What do you actually think >> >> ... for m in msg: >> ... print m >> >> should do? Why do you believe that what you think it should do would be >> a natural choice? > > I needed to know how to extract part

Re: MaildirMessage

2007-07-14 Thread Tzury
> What do you actually think > > ... for m in msg: > ... print m > > should do? Why do you believe that what you think it should do would be > a natural choice? I needed to know how to extract particular parts of a message, such as the message 'body', 'subject', 'author', etc. I co

Re: MaildirMessage

2007-07-13 Thread Steve Holden
Ben Finney wrote: > Steve Holden <[EMAIL PROTECTED]> writes: > >> Ben Finney wrote: >>> Which is a bug in the 'email.message' module, in my view. If it's >>> attempting to support a mapping protocol, it should allow >>> iteration the same way standard Python mappings do: by iterating >>> over the

Re: MaildirMessage

2007-07-13 Thread Ben Finney
Steve Holden <[EMAIL PROTECTED]> writes: > Ben Finney wrote: > > Which is a bug in the 'email.message' module, in my view. If it's > > attempting to support a mapping protocol, it should allow > > iteration the same way standard Python mappings do: by iterating > > over the keys. > > Stop assuming

Re: MaildirMessage

2007-07-13 Thread Gabriel Genellina
En Fri, 13 Jul 2007 07:38:01 -0300, Tzury <[EMAIL PROTECTED]> escribió: >> Which is a bug in the 'email.message' module, in my view. If it's >> attempting to support a mapping protocol, it should allow iteration >> the same way standard Python mappings do: by iterating over the keys. > > I thoug

Re: MaildirMessage

2007-07-13 Thread Steve Holden
Ben Finney wrote: > "Gabriel Genellina" <[EMAIL PROTECTED]> writes: > >> msg is an instance of MaildirMessage (subclass of Message) - it has >> no specific iterator, so "for m in msg" tries to use the sequence >> protocol, starting at 0; that i

Re: MaildirMessage

2007-07-13 Thread Tzury
> Which is a bug in the 'email.message' module, in my view. If it's > attempting to support a mapping protocol, it should allow iteration > the same way standard Python mappings do: by iterating over the keys. I thought it is a bug as well, but who am I a python newbie to say so. I found inspect.g

Re: MaildirMessage

2007-07-12 Thread Ben Finney
"Gabriel Genellina" <[EMAIL PROTECTED]> writes: > msg is an instance of MaildirMessage (subclass of Message) - it has > no specific iterator, so "for m in msg" tries to use the sequence > protocol, starting at 0; that is, tries to get msg[0]. Message > obj

Re: MaildirMessage

2007-07-12 Thread Gabriel Genellina
En Thu, 12 Jul 2007 21:46:32 -0300, Tzury <[EMAIL PROTECTED]> escribió: > I am getting the following error when trying to iterate in a message > in a Maildir directory. > please help. > >>>> from mailbox import Maildir, MaildirMessage >>>> mbox =

MaildirMessage

2007-07-12 Thread Tzury
I am getting the following error when trying to iterate in a message in a Maildir directory. please help. >>> from mailbox import Maildir, MaildirMessage >>> mbox = Maildir('path/to/mailbox', create = False, factory = MaildirMessage) >>>