Try to fix #225 « Runonce (offlineimap -o) does not stop if autorefresh is declared in DEFAULT section »

Signed-off-by: Étienne Deparis <etienne@depar.is>
This commit is contained in:
Étienne Deparis 2015-09-04 12:12:28 +02:00
parent eeb7e89ca6
commit 41692d0328

View File

@ -217,6 +217,9 @@ class OfflineImap:
imaplib.Debug = 5
if options.runonce:
# Must kill the possible default option
if config.has_option('DEFAULT', 'autorefresh'):
config.remove_option('DEFAULT', 'autorefresh')
# FIXME: spaghetti code alert!
for section in accounts.getaccountlist(config):
config.remove_option('Account ' + section, "autorefresh")