Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@type fromCache: C{bool}
@return: C{IMAPClient}
"""
assert isinstance(account, Mail.IMAPAccount)
if not fromCache:
return IMAPClient(self._clientView, account, self._mailWorker)
imapInstances = self._clientInstances.get("IMAP")
if account.itsUUID in imapInstances:
return imapInstances.get(account.itsUUID)
i = IMAPClient(self._clientView, account, self._mailWorker)
imapInstances[account.itsUUID] = i
return i
@param account: A IMAPAccount
@type account: C{IMAPAccount}
@param fromCache: Boolean flag indicating whether the
c{IMAPClient} instance should come from
the cache.
@type fromCache: C{bool}
@return: C{IMAPClient}
"""
assert isinstance(account, Mail.IMAPAccount)
if not fromCache:
return IMAPClient(self._clientView, account, self._mailWorker)
imapInstances = self._clientInstances.get("IMAP")
if account.itsUUID in imapInstances:
return imapInstances.get(account.itsUUID)
i = IMAPClient(self._clientView, account, self._mailWorker)
imapInstances[account.itsUUID] = i
return i