OfflineIMAP/offlineimap — pull request #116 by shuber2 (2014-09-24 10:33:35+00:00)
Title: Do not keep reloading pyhtonfile, make it stateful

CustomConfigParser.getlocaleval() loads "pythonfile" at each call.
Besides unnecessary IO, in case that dynamic_folderfilter is true, the
code in "pythonfile" would behave stateless, since it is re-initialized
at each call of getlocaleval(), i.e., at every sync. Fix that by keeping
a singleton copy of localeval in CustomConfigParser after the first call
of getlocaleval().

Application:
In my personal setup, I only check for mail in Junk/ every couple of hours. To realize this I remember the time when folderfilter() was called for "Junk" the last time and only return True if a couple of hours passed by. Without this patch, however, I cannot recall the time of the last check, as the pythonfile is reloaded at each synchronization.