Complete.Org: Mailing Lists: Archives: offlineimap: June 2009:
using more than one nametrans in offlineimaprc
Home

using more than one nametrans in offlineimaprc

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: offlineimap@xxxxxxxxxxxx
Subject: using more than one nametrans in offlineimaprc
From: James Smith <metal.lunchbox@xxxxxxxxx>
Date: Mon, 1 Jun 2009 17:50:46 -0500

I'm using offlineimap with gmail and mutt and am very satisfied. It just
works, and most importantly it does something that I couldn't really find
anything else to do reliably. Thanks. My question is this. Gmail gives their
folders some stupid names, "[Gmail]/Sent Mail" and "[Gmail]/Drafts". Using
nametrans in offlinimaprc I want to make those "Sent" and "Drafts". I'm not
very familiar with python and I'm not a real expert with regex. This is what
I have in offlinimaprc:
nametrans = lambda foldername:
re.sub('^\[Gmail\]/Drafts','Drafts',foldername)
nametrans = lambda foldername: re.sub('^\[Gmail\]/Sent\
Mail','Sent',foldername)
The problem is that the second "nametrans =" statement simply overrides the
first so that the drafts folder stays as it is. How do I combine these two
into one statement? thanks
james



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