From 2e22b4123190c8ae434efb2bfb3d507694482644 Mon Sep 17 00:00:00 2001 From: Jonny Lamb Date: Tue, 5 May 2009 20:47:11 +0100 Subject: [PATCH] Bug#502779: Sync accounts in order of general.accounts option On Tue, Apr 21, 11:19:00 -0500, John Goerzen wrote: > I think the one loss of functionality we have here is that it doesn't > check if a given account has already been listed before adding to the > list. Should be a simple tweak. If you could tweak that and test, I'd > apply a new patch. Good catch. I attach an updated patch which I've tested and it appears to work fine, including not syncing two accounts twice. Thanks, -- Jonny Lamb, UK jonny@debian.org From 7f348ee116bba64f7330e28d4e7b2c015910a890 Mon Sep 17 00:00:00 2001 From: Jonny Lamb Date: Tue, 05 May 2009 20:45:17 +0100 Subject: [PATCH] Respect order of general.accounts config setting. This makes the order of account synchronisation the same as the order of the general.accounts setting by using a list instead of a dict, which was actually pointless as the value of each dict item was never even looked at. Signed-off-by: Jonny Lamb --- offlineimap/init.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/offlineimap/init.py b/offlineimap/init.py index 526478c..8d888b4 100644 --- a/offlineimap/init.py +++ b/offlineimap/init.py @@ -158,7 +158,7 @@ def startup(versionno): activeaccounts = activeaccounts.split(",") allaccounts = accounts.AccountHashGenerator(config) - syncaccounts = {} + syncaccounts = [] for account in activeaccounts: if account not in allaccounts: if len(allaccounts) == 0: @@ -168,7 +168,8 @@ def startup(versionno): for name in allaccounts.keys(): errormsg += '\n%s'%name ui.terminate(1, errortitle = 'Unknown Account "%s"'%account, errormsg = errormsg) - syncaccounts[account] = allaccounts[account] + if account not in syncaccounts: + syncaccounts.append(account) server = None remoterepos = None