Sanity check to notify us when we call IMAPRepository.getsep() too early
The folder delimiter is only initialized after a call to acquireconnection(), so we must never call this function too early. Include an assert() to make sure we get notified when we do. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
This commit is contained in:
		@@ -74,6 +74,13 @@ class IMAPRepository(BaseRepository):
 | 
			
		||||
            return num
 | 
			
		||||
 | 
			
		||||
    def getsep(self):
 | 
			
		||||
        """Return the folder separator for the IMAP repository
 | 
			
		||||
 | 
			
		||||
        This requires that self.imapserver has been initialized with an
 | 
			
		||||
        acquireconnection() or it will still be `None`"""
 | 
			
		||||
        assert self.imapserver.delim != None, "'%s' " \
 | 
			
		||||
            "repository called getsep() before the folder separator was " \
 | 
			
		||||
            "queried from the server" % self
 | 
			
		||||
        return self.imapserver.delim
 | 
			
		||||
 | 
			
		||||
    def gethost(self):
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user