All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
1 def py_foldersort_seamus(x, y):
2 prioritised = ('outgoing','resubmit','drafts','inbox','phd','ul','debian','sudetia','admin','retrain')
3 deprioritised = ('discard','spam','store','spool')
4 for prefix in prioritised:
5 if x.startswith(prefix):
7 elif y.startswith(prefix):
9 for prefix in deprioritised:
10 if x.startswith(prefix):
12 elif y.startswith(prefix):
18 def py_nametrans_seamus(x):
19 return re.sub('^INBOX', 'inbox', x)
21 def should_do_full_sync():
23 FILE = os.path.expanduser('~/.var/offlineimap/lastrun')
25 now = int(time.time())
28 mtime = os.stat(FILE)[stat.ST_MTIME]
33 print 'now=%d mtime=%d since=%d INTERVAL=%d' \
34 % (now, mtime, since, INTERVAL)
36 file(FILE, 'wb').close()
37 print 'Running a full sync...'
40 print 'Running a partial sync, next full sync in %d seconds...' \
44 #do_full = should_do_full_sync()
46 def py_folderfilter_seamus(x):
47 base_excludes = ['delayed', 'outgoing', 'Trash', 'Sent']
50 return x not in base_excludes
52 if x in base_excludes:
54 if x in ('spool', 'discard', 'spam'):
56 if re.search('^store\..+', x):
60 def py_folderfilter_mbnames(acct, x):
61 return acct in ['seamus.madduck.net'] \
62 and not re.search('^(store(/.+)?|retrain/(ham|spam)|spool|discard|spam)', x)