/head: changeset 67

More working!
This commit is contained in:
jgoerzen 2002-07-04 03:14:07 +01:00
parent cabb768745
commit f53273ffc3
5 changed files with 12 additions and 2 deletions

View File

@ -85,7 +85,8 @@ def syncaccount(accountname, *args):
# Connect to the remote server.
server = imapserver.IMAPServer(user, passwords[accountname],
host, port, ssl)
host, port, ssl,
config.getint(accountname, "maxconnections"))
remoterepos = repository.IMAP.IMAPRepository(config, accountname, server)
# Connect to the Maildirs.

View File

@ -17,6 +17,7 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
import __main__
from threading import *
class BaseFolder:
def getname(self):

View File

@ -127,7 +127,7 @@ class IMAPFolder(BaseFolder):
self.messagelist[uid]['flags'] = imaputil.flagsimap2maildir(flags)
def addmessagesflags(self, uidlist, flags):
imapobj = self.imapserver.acquireconnection(imapobj)
imapobj = self.imapserver.acquireconnection()
try:
imapobj.select(self.getfullname())
r = imapobj.uid('store',

View File

@ -18,6 +18,7 @@
from offlineimap import imaplib, imaputil, threadutil
from threading import *
import sys
class UsefulIMAPMixIn:
def getstate(self):
@ -81,6 +82,8 @@ class IMAPServer:
self.availableconnections.append(connection)
self.connectionlock.release()
self.semaphore.release()
print "%d connections used after release" % len(self.assignedconnections)
sys.stdout.flush()
def acquireconnection(self):
@ -98,6 +101,8 @@ class IMAPServer:
self.assignedconnections.append(imapobj)
del(self.availableconnections[0])
self.connectionlock.release()
print "%d connections used after acquire" % len(self.assignedconnections)
sys.stdout.flush()
return imapobj
self.connectionlock.release() # Release until need to modify data
@ -119,6 +124,8 @@ class IMAPServer:
self.connectionlock.acquire()
self.assignedconnections.append(imapobj)
self.connectionlock.release()
print "%d connections used after acquire" % len(self.assignedconnections)
sys.stdout.flush()
return imapobj
def connectionwait(self):

View File

@ -8,6 +8,7 @@ class TTYUI(UIBase):
def _msg(s, msg):
print msg
sys.stdout.flush()
def getpass(s, accountname, config):
return getpass("%s: Enter password for %s on %s: " %