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 <Sebastian@SSpaeth.de>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:
Sebastian Spaeth 2011-04-05 12:16:43 +02:00 committed by Nicolas Sebrecht
parent 69d2185c23
commit d762175af4
2 changed files with 6 additions and 1 deletions

View File

@ -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
---------

View File

@ -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):