From a2a8a908ca1819e8359944e2fb0f401bf91db975 Mon Sep 17 00:00:00 2001 From: Nicolas Sebrecht Date: Thu, 19 May 2016 08:35:45 +0200 Subject: [PATCH] threading: fix variable names about namespaces Signed-off-by: Nicolas Sebrecht --- offlineimap/imapserver.py | 2 ++ offlineimap/init.py | 6 +++--- offlineimap/repository/IMAP.py | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/offlineimap/imapserver.py b/offlineimap/imapserver.py index dc36f69..969f2e8 100644 --- a/offlineimap/imapserver.py +++ b/offlineimap/imapserver.py @@ -60,6 +60,8 @@ class IMAPServer(object): GSS_STATE_WRAP = 1 def __init__(self, repos): + """:repos: a IMAPRepository instance.""" + self.ui = getglobalui() self.repos = repos self.config = repos.getconfig() diff --git a/offlineimap/init.py b/offlineimap/init.py index d0a98de..c4dc611 100644 --- a/offlineimap/init.py +++ b/offlineimap/init.py @@ -299,13 +299,13 @@ class OfflineImap: # connections for a remote IMAP server, why do we allow twice this # number? The max connections number is used by both the FOLDER_ and # the MSGCOPY_ prefixes! - for instancename in [accounts.FOLDER_NAMESPACE + reposname, + for namespace in [accounts.FOLDER_NAMESPACE + reposname, MSGCOPY_NAMESPACE + reposname]: if options.singlethreading: - threadutil.initInstanceLimit(instancename, 1) + threadutil.initInstanceLimit(namespace, 1) else: threadutil.initInstanceLimit( - instancename, + namespace, config.getdefaultint( 'Repository ' + reposname, 'maxconnections', 2) diff --git a/offlineimap/repository/IMAP.py b/offlineimap/repository/IMAP.py index 755f2ce..4fb2065 100644 --- a/offlineimap/repository/IMAP.py +++ b/offlineimap/repository/IMAP.py @@ -20,6 +20,7 @@ import os from sys import exc_info import netrc import errno +import six from offlineimap.repository.Base import BaseRepository from offlineimap import folder, imaputil, imapserver, OfflineImapError @@ -27,12 +28,11 @@ from offlineimap.folder.UIDMaps import MappedIMAPFolder from offlineimap.threadutil import ExitNotifyThread from offlineimap.utils.distro import get_os_sslcertfile, get_os_sslcertfile_searchpath -import six - class IMAPRepository(BaseRepository): def __init__(self, reposname, account): """Initialize an IMAPRepository object.""" + BaseRepository.__init__(self, reposname, account) # self.ui is being set by the BaseRepository self._host = None