':repos: a IMAPRepository instance.'

def __init__(self, repos):

    self.ui = getglobalui()
    self.repos = repos
    self.config = repos.getconfig()
    self.preauth_tunnel = repos.getpreauthtunnel()
    self.transport_tunnel = repos.gettransporttunnel()
    if (self.preauth_tunnel and self.transport_tunnel):
        raise OfflineImapError((('%s:    ' % repos) + 'you    must    enable    precisely    one    type    of    tunnel    (preauth    or    transport),    not    both'), OfflineImapError.ERROR.REPO)
    self.tunnel = (self.preauth_tunnel if self.preauth_tunnel else self.transport_tunnel)
    self.username = (None if self.preauth_tunnel else repos.getuser())
    self.user_identity = repos.get_remote_identity()
    self.authmechs = repos.get_auth_mechanisms()
    self.password = None
    self.passworderror = None
    self.goodpassword = None
    self.usessl = repos.getssl()
    self.useipv6 = repos.getipv6()
    if (self.useipv6 is True):
        self.af = socket.AF_INET6
    elif (self.useipv6 is False):
        self.af = socket.AF_INET
    else:
        self.af = socket.AF_UNSPEC
    self.hostname = (None if self.preauth_tunnel else repos.gethost())
    self.port = repos.getport()
    if (self.port is None):
        self.port = (993 if self.usessl else 143)
    self.sslclientcert = repos.getsslclientcert()
    self.sslclientkey = repos.getsslclientkey()
    self.sslcacertfile = repos.getsslcacertfile()
    if (self.sslcacertfile is None):
        self.__verifycert = None
    self.fingerprint = repos.get_ssl_fingerprint()
    self.tlslevel = repos.gettlslevel()
    self.sslversion = repos.getsslversion()
    self.starttls = repos.getstarttls()
    if ((self.tlslevel is not 'tls_compat') and (self.sslversion is None)):
        raise Exception("When    'tls_version'    is    not    'tls_compat'    the    'ssl_version'    must    be    set    explicitly.")
    self.oauth2_refresh_token = repos.getoauth2_refresh_token()
    self.oauth2_access_token = repos.getoauth2_access_token()
    self.oauth2_client_id = repos.getoauth2_client_id()
    self.oauth2_client_secret = repos.getoauth2_client_secret()
    self.oauth2_request_url = repos.getoauth2_request_url()
    self.delim = None
    self.root = None
    self.maxconnections = repos.getmaxconnections()
    self.availableconnections = []
    self.assignedconnections = []
    self.lastowner = {}
    self.semaphore = BoundedSemaphore(self.maxconnections)
    self.connectionlock = Lock()
    self.reference = repos.getreference()
    self.idlefolders = repos.getidlefolders()
    self.gss_step = self.GSS_STATE_STEP
    self.gss_vc = None
    self.gssapi = False
    self.proxied_socket = self._get_proxy('proxy', socket.socket)
    self.authproxied_socket = self._get_proxy('authproxy', self.proxied_socket)
