From d762175af410eb0f9bd23bf403bade6847879521 Mon Sep 17 00:00:00 2001 From: Sebastian Spaeth Date: Tue, 5 Apr 2011 12:16:43 +0200 Subject: [PATCH] Make -f option with with folder names with spaces. Previously ALL spaces had been stripped off. Now, only strip spaces around the comma, so -f "INBOX, Deleted Mails" will work. You will still need to quote or escape spaces so the shell hand the list as one command line argument to offlineimap. Signed-off-by: Sebastian Spaeth Signed-off-by: Nicolas Sebrecht --- Changelog.draft.rst | 3 +++ offlineimap/init.py | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Changelog.draft.rst b/Changelog.draft.rst index 0a85888..969655b 100644 --- a/Changelog.draft.rst +++ b/Changelog.draft.rst @@ -16,6 +16,9 @@ New Features Changes ------- +* the -f option did not work with Folder names with spaces. It works + now, use with quoting e.g. -f "INBOX, Deleted Mails". + Bug Fixes --------- diff --git a/offlineimap/init.py b/offlineimap/init.py index 96d4e50..296b84b 100644 --- a/offlineimap/init.py +++ b/offlineimap/init.py @@ -238,8 +238,10 @@ class OfflineImap: for section in accounts.getaccountlist(config): config.set('Account ' + section, "quick", '-1') + #custom folder list specified? if options.folders: - foldernames = options.folders.replace(" ", "").split(",") + foldernames = map(lambda s: s.strip(), + options.folders.split(",")) folderfilter = "lambda f: f in %s" % foldernames folderincludes = "[]" for accountname in accounts.getaccountlist(config):