Implement connect
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
# Base repository support
|
||||
# Copyright (C) 2002, 2003, 2006 John Goerzen
|
||||
# Copyright (C) 2002-2007 John Goerzen
|
||||
# <jgoerzen@complete.org>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
@ -63,6 +63,15 @@ class BaseRepository(CustomConfig.ConfigHelperMixin):
|
||||
|
||||
return self.restore_folder_atimes()
|
||||
|
||||
def connect(self):
|
||||
"""Establish a connection to the remote, if necessary. This exists
|
||||
so that IMAP connections can all be established up front, gathering
|
||||
passwords as needed. It was added in order to support the
|
||||
error recovery -- we need to connect first outside of the error
|
||||
trap in order to validate the password, and that's the point of
|
||||
this function."""
|
||||
pass
|
||||
|
||||
def holdordropconnections(self):
|
||||
pass
|
||||
|
||||
|
@ -156,6 +156,10 @@ class IMAPRepository(BaseRepository):
|
||||
def getfoldertype(self):
|
||||
return folder.IMAP.IMAPFolder
|
||||
|
||||
def connect(self):
|
||||
imapobj = self.imapserver.acquireconnection()
|
||||
self.imapserver.releaseconnection(imapobj)
|
||||
|
||||
def getfolders(self):
|
||||
if self.folders != None:
|
||||
return self.folders
|
||||
|
Reference in New Issue
Block a user