[PATCH 3/3] Improve our MANUAL

Dan Christensen jdc at uwo.ca
Thu Aug 25 15:16:18 BST 2011


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





More information about the OfflineIMAP-project mailing list