Complete.Org: Mailing Lists: Archives: offlineimap: July 2002:
Re: Dots in dir names
Home

Re: Dots in dir names

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Robert Flemming <flemming@xxxxxxxxxxxxx>
Cc: offlineimap@xxxxxxxxxxxx
Subject: Re: Dots in dir names
From: Martijn Pieters <mj@xxxxxxxx>
Date: Tue, 16 Jul 2002 15:03:35 -0400

On Tue, Jul 16, 2002 at 11:43:59AM -0700, Robert Flemming wrote:
> My related question is how can I get rid the Mail prefix to all of
> mailboxes.  You might have guessed I'm using uw-imapd.  I tried digging
> through the mailing list archives but there doesn't seem to be any :)  It
> may just be a nametrans thing, but I wanted to see if I was missing
> something obvious first.

Use a nametrans function. Use a regular expression along the lines of:

  re.sub('(?P<boxname>[^/]+)/(?P=boxname)', '\g<boxname>', name)

This (lightly tested) expression will reduce any double name separated by a
slash to only one name. Thus 'Trash/Trash' becomes just 'Trash'. A nametrans
function is applied on the remote foldername, not the local one.

For more information on Python and regular expressions, see:

  http://www.python.org/doc/current/lib/module-re.html

-- 
Martijn Pieters
| Software Engineer  mailto:mj@xxxxxxxx
| Zope Corporation   http://www.zope.com/
| Creators of Zope   http://www.zope.org/
---------------------------------------------


[Prev in Thread] Current Thread [Next in Thread]