[PATCH 3/3] Improve our MANUAL

Daniel Shahaf d.s at daniel.shahaf.name
Thu Aug 25 09:40:41 BST 2011


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?




More information about the OfflineIMAP-project mailing list