[PATCH 3/3] Re: Improve our MANUAL

Nicolas Sebrecht nicolas.s-dev at laposte.net
Fri Aug 26 20:09:42 BST 2011


On Thu, Aug 25, 2011 at 10:16:18AM -0400, Dan Christensen wrote:
> Daniel Shahaf <d.s at daniel.shahaf.name> writes:
> 
> > Sebastian Spaeth wrote on Thu, Aug 25, 2011 at 10:18:05 +0200:
> >> +Another nametrans transpose example
> >> +-----------------------------------
> >> +
> >> +Put everything in a GMX. subfolder except for the boxes INBOX, Draft, and Sent which should keep the same name::
> >> +
> >> +     folderfilter = lambda folder: re.sub(r'^(?!INBOX$|Draft$|Sent$)',r'GMX.', folder)
> >
> > Given that the target audience isn't exclusively Python programmers, how
> > about
> >
> >   +     folderfilter = lambda folder: (folder in ['INBOX', 'Drafts', 'Sent'] \
> >                                        and folder or re.sub(r'^', r'GMX.', folder))
> >
> > which is equivalent but easier to generalize?
> 
> Both should be "nametrans", right?
> 
> Does offlineimap require a new enough python that the example could be
> 
>   folder if folder in ['INBOX', 'Drafts', 'Sent'] \
>   else re.sub(r'^', r'GMX.', folder)
> 
> Dan

I've taken this patch as is but any improvement in this area would be
welcome. ,-)

-- 
Nicolas Sebrecht




More information about the OfflineIMAP-project mailing list