mailbox.Maildir(), confusing documentation

tinnews at isbd.co.uk tinnews at isbd.co.uk
Sun Apr 6 06:39:41 EDT 2008


Peter Otten <__peter__ at web.de> wrote:
> tinnews at isbd.co.uk wrote:
> 
> > Having got my Python 2.5.2 installed I'm trying some things out with
> > the mailbox.Maildir() class.
> > 
> > If I do the following:-
> > 
> >     import maibox
> >     mailbox.Maildir("/home/isbd/Mail/Li/pytest")
> > 
> > then the pytest Maildir mailbox is created - which is great but isn't
> > documented.  If the above creates the maildir then what is the
> > mailbox.Maildir.add_folder() method for?  I tried
> > mailbox.Maildir.add_folder() and it appeared to do nothing, it didn't
> > produce any errors either.
> 
> You didn't expect the dot, it seems:
> 
I didn't 'expect' the dot because it's not standard maildir syntax,
it's just one particular way of doing it.

... but thanks for pointing out what was going on.  :-)

> >>> import mailbox
> >>> m = mailbox.Maildir("alpha")
> >>> m.add_folder("beta")
> <mailbox.Maildir instance at 0x2af9e9e51f80>
> >>>
> $ find .
> .
> ./alpha
> ./alpha/tmp
> ./alpha/cur
> ./alpha/new
> ./alpha/.beta
> ./alpha/.beta/tmp
> ./alpha/.beta/cur
> ./alpha/.beta/new
> ./alpha/.beta/maildirfolder
> $
> 
> Peter

-- 
Chris Green



More information about the Python-list mailing list