IMAP class: don't suggest multithreading in single-threaded mode
Signed-off-by: Eygene Ryabinkin <rea@codelabs.ru>
This commit is contained in:
		@@ -23,6 +23,7 @@ import time
 | 
				
			|||||||
from sys import exc_info
 | 
					from sys import exc_info
 | 
				
			||||||
from .Base import BaseFolder
 | 
					from .Base import BaseFolder
 | 
				
			||||||
from offlineimap import imaputil, imaplibutil, OfflineImapError
 | 
					from offlineimap import imaputil, imaplibutil, OfflineImapError
 | 
				
			||||||
 | 
					from offlineimap import globals
 | 
				
			||||||
from offlineimap.imaplib2 import MonthNames
 | 
					from offlineimap.imaplib2 import MonthNames
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -53,7 +54,7 @@ class IMAPFolder(BaseFolder):
 | 
				
			|||||||
            imapobj.select(self.getfullname(), readonly = True, force = force)
 | 
					            imapobj.select(self.getfullname(), readonly = True, force = force)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def suggeststhreads(self):
 | 
					    def suggeststhreads(self):
 | 
				
			||||||
        return 1
 | 
					        return not globals.options.singlethreading
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def waitforthread(self):
 | 
					    def waitforthread(self):
 | 
				
			||||||
        self.imapserver.connectionwait()
 | 
					        self.imapserver.connectionwait()
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user