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

2009-10-01 Thread Aahz
In article h9o1bf$cm...@news.eternal-september.org,
 tinn...@isbd.co.uk wrote:
Tim Roberts t...@probo.com wrote:
 tinn...@isbd.co.uk wrote:

My maildir hierarchy is created by mutt which is a *very* standards
compliant MUA, surely standard python libraries should work with
standard maildirs not some wierd extension thereof.
 
 The Maildir specification does not allow for subfolders.  That was added in
 Maildir++, and the subfolder names start with a dot.  It's not a wierd
 extension thereof.

No sub-folders within maildir folders but that's not what I was expecting.

I was just expecting to be able to list my maildir mailboxes.

Now you know why *my* mutt uses mboxes.  ;-)
-- 
Aahz (a...@pythoncraft.com)   * http://www.pythoncraft.com/

Normal is what cuts off your sixth finger and your tail...  --Siobhan
-- 
http://mail.python.org/mailman/listinfo/python-list


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

2009-09-27 Thread tinnews
Tim Roberts t...@probo.com wrote:
 tinn...@isbd.co.uk wrote:
 
 My maildir hierarchy is created by mutt which is a *very* standards
 compliant MUA, surely standard python libraries should work with
 standard maildirs not some wierd extension thereof.
 
 The Maildir specification does not allow for subfolders.  That was added in
 Maildir++, and the subfolder names start with a dot.  It's not a wierd
 extension thereof.

No sub-folders within maildir folders but that's not what I was expecting.

I was just expecting to be able to list my maildir mailboxes.

-- 
Chris Green

-- 
http://mail.python.org/mailman/listinfo/python-list


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

2009-09-26 Thread tinnews
Jeff McNeil j...@jmcneil.net wrote:
   The Maildir++ spec states that folders need to begin with a period.
   The list_folders method enforces that:
 
       def list_folders(self):
           Return a list of folder names.
           result = []
           for entry in os.listdir(self._path):
               if len(entry)  1 and entry[0] == '.' and \
                  os.path.isdir(os.path.join(self._path, entry)):
                   result.append(entry[1:])
           return result
 
   The above example is from 2.6.  Your structure is simply a list of
   Maildir compliant directories below '/home/chris/Mail/apex.' They're
   not, in the Maildir++ sense of the word, folders.
 
  So where does it say in the Python documentation that list_folders()
  works only with Maildir++?  It's a big and non-obvious limitation to
  my mind.
 
  My maildir hierarchy is created by mutt which is a *very* standards
  compliant MUA, surely standard python libraries should work with
  standard maildirs not some wierd extension thereof.
 
  --
  Chris Green
 
 
 The doc says that Folders of the style introduced by the Courier mail
 transfer agent are also supported. Any subdirectory of the main

... are also supported. says to me that 'standard' ones are
supported as well and they're *not*.

 mailbox is considered a folder if '.' is the first character in its
 name.  It's not an explicit endorsement of Maildir++, but it touches
 on what it considers a folder definition. I'm treading on hazy memory
 here, but I believe Maildir++ is the definition provided by the
 Courier folks.
 
So why isn't the class called mailbox.Maildir++ ?   :-)

-- 
Chris Green

-- 
http://mail.python.org/mailman/listinfo/python-list


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

2009-09-26 Thread tinnews
Jeff McNeil j...@jmcneil.net wrote:
   My maildir hierarchy is created by mutt which is a *very* standards
   compliant MUA, surely standard python libraries should work with
   standard maildirs not some wierd extension thereof.
 
   --
   Chris Green
 
  The doc says that Folders of the style introduced by the Courier mail
  transfer agent are also supported. Any subdirectory of the main
  mailbox is considered a folder if '.' is the first character in its
  name.  It's not an explicit endorsement of Maildir++, but it touches
  on what it considers a folder definition. I'm treading on hazy memory
  here, but I believe Maildir++ is the definition provided by the
  Courier folks.
 
  --
  Thanks,
 
  Jeff
  mcjeff.blogspot.com
 
 http://wiki.mutt.org/?MuttFaq/Maildir
 
 That might help as well. You can have Mutt setup your folders using
 that extended method.
 
Thanks, but no thanks.  It creates 'folders' which aren't proper
hierarchical directories at all and breaks all sorts of standard
Unix/Linux ways of handling data.  It's basically *horrible* and
to be avoided at all costs if you actually want to have a local mail
spool. It's OK if it's hidden behind an IMAP mail server or something
but otherwise no.

-- 
Chris Green

-- 
http://mail.python.org/mailman/listinfo/python-list


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

2009-09-26 Thread Tim Roberts
tinn...@isbd.co.uk wrote:

My maildir hierarchy is created by mutt which is a *very* standards
compliant MUA, surely standard python libraries should work with
standard maildirs not some wierd extension thereof.

The Maildir specification does not allow for subfolders.  That was added in
Maildir++, and the subfolder names start with a dot.  It's not a wierd
extension thereof.
-- 
Tim Roberts, t...@probo.com
Providenza  Boekelheide, Inc.
-- 
http://mail.python.org/mailman/listinfo/python-list


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

2009-09-25 Thread Jeff McNeil
On Sep 25, 3:22 pm, tinn...@isbd.co.uk wrote:
 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

The Maildir++ spec states that folders need to begin with a period.
The list_folders method enforces that:

def list_folders(self):
Return a list of folder names.
result = []
for entry in os.listdir(self._path):
if len(entry)  1 and entry[0] == '.' and \
   os.path.isdir(os.path.join(self._path, entry)):
result.append(entry[1:])
return result

The above example is from 2.6.  Your structure is simply a list of
Maildir compliant directories below '/home/chris/Mail/apex.' They're
not, in the Maildir++ sense of the word, folders.

--
Thanks,

Jeff
mcjeff.blospot.com
-- 
http://mail.python.org/mailman/listinfo/python-list


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

2009-09-25 Thread tinnews
Jeff McNeil j...@jmcneil.net wrote:
 On Sep 25, 3:22 pm, tinn...@isbd.co.uk wrote:
  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
 
 The Maildir++ spec states that folders need to begin with a period.
 The list_folders method enforces that:
 
 def list_folders(self):
 Return a list of folder names.
 result = []
 for entry in os.listdir(self._path):
 if len(entry)  1 and entry[0] == '.' and \
os.path.isdir(os.path.join(self._path, entry)):
 result.append(entry[1:])
 return result
 
 The above example is from 2.6.  Your structure is simply a list of
 Maildir compliant directories below '/home/chris/Mail/apex.' They're
 not, in the Maildir++ sense of the word, folders.
 
So where does it say in the Python documentation that list_folders()
works only with Maildir++?  It's a big and non-obvious limitation to
my mind.

My maildir hierarchy is created by mutt which is a *very* standards
compliant MUA, surely standard python libraries should work with
standard maildirs not some wierd extension thereof.

-- 
Chris Green

-- 
http://mail.python.org/mailman/listinfo/python-list


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

2009-09-25 Thread Jeff McNeil
On Sep 25, 4:13 pm, tinn...@isbd.co.uk wrote:
 Jeff McNeil j...@jmcneil.net wrote:
  On Sep 25, 3:22 pm, tinn...@isbd.co.uk wrote:
   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

  The Maildir++ spec states that folders need to begin with a period.
  The list_folders method enforces that:

      def list_folders(self):
          Return a list of folder names.
          result = []
          for entry in os.listdir(self._path):
              if len(entry)  1 and entry[0] == '.' and \
                 os.path.isdir(os.path.join(self._path, entry)):
                  result.append(entry[1:])
          return result

  The above example is from 2.6.  Your structure is simply a list of
  Maildir compliant directories below '/home/chris/Mail/apex.' They're
  not, in the Maildir++ sense of the word, folders.

 So where does it say in the Python documentation that list_folders()
 works only with Maildir++?  It's a big and non-obvious limitation to
 my mind.

 My maildir hierarchy is created by mutt which is a *very* standards
 compliant MUA, surely standard python libraries should work with
 standard maildirs not some wierd extension thereof.

 --
 Chris Green


The doc says that Folders of the style introduced by the Courier mail
transfer agent are also supported. Any subdirectory of the main
mailbox is considered a folder if '.' is the first character in its
name.  It's not an explicit endorsement of Maildir++, but it touches
on what it considers a folder definition. I'm treading on hazy memory
here, but I believe Maildir++ is the definition provided by the
Courier folks.

--
Thanks,

Jeff
mcjeff.blogspot.com
-- 
http://mail.python.org/mailman/listinfo/python-list


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

2009-09-25 Thread Jeff McNeil
On Sep 25, 4:28 pm, Jeff McNeil j...@jmcneil.net wrote:
 On Sep 25, 4:13 pm, tinn...@isbd.co.uk wrote:





  Jeff McNeil j...@jmcneil.net wrote:
   On Sep 25, 3:22 pm, tinn...@isbd.co.uk wrote:
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

   The Maildir++ spec states that folders need to begin with a period.
   The list_folders method enforces that:

       def list_folders(self):
           Return a list of folder names.
           result = []
           for entry in os.listdir(self._path):
               if len(entry)  1 and entry[0] == '.' and \
                  os.path.isdir(os.path.join(self._path, entry)):
                   result.append(entry[1:])
           return result

   The above example is from 2.6.  Your structure is simply a list of
   Maildir compliant directories below '/home/chris/Mail/apex.' They're
   not, in the Maildir++ sense of the word, folders.

  So where does it say in the Python documentation that list_folders()
  works only with Maildir++?  It's a big and non-obvious limitation to
  my mind.

  My maildir hierarchy is created by mutt which is a *very* standards
  compliant MUA, surely standard python libraries should work with
  standard maildirs not some wierd extension thereof.

  --
  Chris Green

 The doc says that Folders of the style introduced by the Courier mail
 transfer agent are also supported. Any subdirectory of the main
 mailbox is considered a folder if '.' is the first character in its
 name.  It's not an explicit endorsement of Maildir++, but it touches
 on what it considers a folder definition. I'm treading on hazy memory
 here, but I believe Maildir++ is the definition provided by the
 Courier folks.

 --
 Thanks,

 Jeff
 mcjeff.blogspot.com

http://wiki.mutt.org/?MuttFaq/Maildir

That might help as well. You can have Mutt setup your folders using
that extended method.

--
Thanks,

Jeff
mcjeff.blogspot.com
-- 
http://mail.python.org/mailman/listinfo/python-list