From 189d78cc5c5215ad265f23374a13209d49dacec8 Mon Sep 17 00:00:00 2001 From: Sebastian Spaeth Date: Thu, 16 Feb 2012 11:12:07 +0100 Subject: [PATCH] sync_folder_structure: make more readable Rename variable src_name to src_name_t to indicate that it is the transposed name. Also rather than testing the hash thingie, we can simply test for "if source_name_t in dst_folders" now. Signed-off-by: Sebastian Spaeth --- offlineimap/repository/Base.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/offlineimap/repository/Base.py b/offlineimap/repository/Base.py index cca5cf3..22fc15f 100644 --- a/offlineimap/repository/Base.py +++ b/offlineimap/repository/Base.py @@ -156,20 +156,20 @@ class BaseRepository(CustomConfig.ConfigHelperMixin, object): dst_hash[folder.name] = folder # Find new folders on src_repo. - for src_name, src_folder in src_hash.iteritems(): + for src_name_t, src_folder in src_hash.iteritems(): # Don't create on dst_repo, if it is readonly if dst_repo.getconfboolean('readonly', False): break - if src_folder.sync_this and not src_name in dst_hash: + if src_folder.sync_this and not src_name_t in dst_folders: try: - dst_repo.makefolder(src_name) + dst_repo.makefolder(src_name_t) dst_haschanged = True # Need to refresh list except OfflineImapError as e: self.ui.error(e, exc_info()[2], "Creating folder %s on repository %s" %\ - (src_name, dst_repo)) + (src_name_t, dst_repo)) raise - status_repo.makefolder(src_name.replace(dst_repo.getsep(), + status_repo.makefolder(src_name_t.replace(dst_repo.getsep(), status_repo.getsep())) # Find new folders on dst_repo. for dst_name, dst_folder in dst_hash.iteritems():