X-Git-Url: https://git.madduck.net/etc/offlineimap.git/blobdiff_plain/aefbbc15b27499b05113fa342fa165b3ab4341ba..42277b632fb6fdcb1f5c839935a2efbab264be5a:/.offlineimap/helper.py diff --git a/.offlineimap/helper.py b/.offlineimap/helper.py index 15824d2..b0f97fa 100644 --- a/.offlineimap/helper.py +++ b/.offlineimap/helper.py @@ -29,11 +29,10 @@ def should_do_full_sync(): now = int(time.time()) try: - mtime = os.stat(FILE)[stat.ST_MTIME] - except OSError: - mtime = 0 + since = now - os.stat(FILE)[stat.ST_MTIME] + except: + since = INTERVAL + 1 - since = now - mtime if since > INTERVAL: file(FILE, 'wb').close() return True @@ -45,15 +44,12 @@ def should_do_full_sync(): do_full_sync = should_do_full_sync() def py_folderfilter_seamus(x): - if do_full_sync: - return x not in base_excludes - else: - if x in base_excludes: - return False - if x in ('spool', 'discard', 'spam'): - return False - if re.search('^store(\..+)?', x): - return False + if x in base_excludes: + return False + + elif re.search('^(' + '|'.join(full_excludes_re) + ')', x): + return do_full_sync + return True def py_folderfilter_mbnames(acct, x):