Fix folder parsing. Fixes issue #108

This commit is contained in:
Patrick Ulbrich
2015-12-20 20:08:12 +01:00
parent 1bfc617434
commit 7256dc6e73

View File

@@ -103,9 +103,19 @@ class Account:
finally:
# conn.close() # allowed in SELECTED state only
conn.logout()
separators = [ ' "/" ', ' "." ' ]
for d in data:
folder = ''
for s in separators:
if s in d:
folder = d.split(s)[-1]
break
if len(folder) == 0:
logging.warning("Folder format not supported.")
break
for s in data:
folder = s.split(' "/" ')[-1]
if (folder[0] == '"') and (folder[-1] == '"'):
folder = folder[1:-1]