[PATCH] Simplify testing for 'subscribedonly' setting

Sebastian Spaeth Sebastian at SSpaeth.de
Thu Sep 15 14:45:09 BST 2011


We only explicitly tested for 'yes' when we have a nice function to get
boolean settings which also works with Treu/False/NO, etc...

Signed-off-by: Sebastian Spaeth <Sebastian at SSpaeth.de>
---
 offlineimap/repository/IMAP.py |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/offlineimap/repository/IMAP.py b/offlineimap/repository/IMAP.py
index 76d0870..daa31c9 100644
--- a/offlineimap/repository/IMAP.py
+++ b/offlineimap/repository/IMAP.py
@@ -280,8 +280,7 @@ class IMAPRepository(BaseRepository):
         imapobj = self.imapserver.acquireconnection()
         # check whether to list all folders, or subscribed only
         listfunction = imapobj.list
-        if self.config.has_option(self.getsection(), 'subscribedonly'):
-          if self.getconf('subscribedonly') == "yes":
+        if self.getconfboolean('subscribedonly', False):
             listfunction = imapobj.lsub
         try:
             listresult = listfunction(directory = self.imapserver.reference)[1]
-- 
1.7.4.1





More information about the OfflineIMAP-project mailing list