What does the list_folders() method of mailbox.Maildir actually do (if anything)?

tinnews at isbd.co.uk tinnews at isbd.co.uk
Fri Sep 25 15:22:53 EDT 2009


I can't get the list_folders() method of the mailbox.Maildir class to
do anything remotely useful.  It seems to do nothing at all.  I have a
directory which contains a number of maildir malboxes:-

    chris$ ls -l /home/chris/Mail/apex
    total 24
    drwx------ 5 chris chris 4096 2009-04-30 09:45 charles.rustin
    drwx------ 5 chris chris 4096 2009-04-30 09:45 greg
    drwx------ 5 chris chris 4096 2009-04-30 09:45 maureenMcgoldrick
    drwx------ 5 chris chris 4096 2009-04-30 09:45 ram
    drwx------ 5 chris chris 4096 2009-04-30 09:46 sarahLagley
    drwx------ 5 chris chris 4096 2009-04-30 09:46 symonSmith
    chris$ ls -l /home/chris/Mail/apex/ram
    total 12
    drwx------ 2 chris chris 4096 2009-04-30 09:45 cur
    drwx------ 2 chris chris 4096 2009-04-30 09:45 new
    drwx------ 2 chris chris 4096 2009-04-30 09:45 tmp


If I run the following code:-

    #!/usr/bin/python
    #
    #
    # Mail archiving utility
    #
    import mailbox
     
    topLevel=mailbox.Maildir("/home/chris/Mail/apex")
    print topLevel.list_folders()

It just outputs "[]".

Am I doing something totally wrong or is list_folders() completely broken?


-- 
Chris Green




More information about the Python-list mailing list