<DKIM> python in offlineimaprc

Nicolas Sebrecht nicolas.s-dev at laposte.net
Sun Aug 19 18:49:18 BST 2018


I wrote it wrong in the pythonfile, here's the correct version.

On Sun, Aug 19, 2018 at 06:58:00PM +0200, Nicolas Sebrecht wrote:
> On Sun, Aug 19, 2018 at 02:17:07PM +0000, J. Tull wrote:
> 
> 
> > this becomes in offlineimap rc file like this:
> > 
> >     folderfilter = lambda folder: folder in \
> >     	[ ??my_dict[item_][0]?? for item_ in %(my_dict)s ]
> 
> 
> # pythonfile:
> 
> ALL_ACCOUNTS_FOLDERFILTER_DICT = {
>   'account_a': ['one', 'two'],
>   'account_b': ['three', 'four'],
> }
> 
> def get_filtered_folders(account_key_name):
>   return ALL_ACCOUNTS_FOLDERFILTER_DICT[account_key_name]

# pythonfile

FOLDERFILTER_DICT = {
    'account_a': ['one', 'two'],
    'account_b': ['three', 'four'],
}


def get_folderfilter_function(account_key_name):
    def folderfilter_function(folder):
        return folder in FOLDERFILTER_DICT[account_key_name]
    return folderfilter_function

> # offlineimaprc
> 
> folderfilter = get_filtered_folders('account_a')
> 
> -- 
> Nicolas Sebrecht

-- 
Nicolas Sebrecht




More information about the OfflineIMAP-project mailing list