':param account: :class:`Account`
:param regtype: \'remote\', \'local\', or \'status\''

def __new__(cls, account, reqtype):

    if (reqtype == 'remote'):
        name = account.getconf('remoterepository')
        typemap = {'IMAP': IMAPRepository, 'Gmail': GmailRepository}
    elif (reqtype == 'local'):
        name = account.getconf('localrepository')
        typemap = {'IMAP': MappedIMAPRepository, 'Maildir': MaildirRepository, 'GmailMaildir': GmailMaildirRepository}
    elif (reqtype == 'status'):
        name = account.getconf('localrepository')
        return LocalStatusRepository(name, account)
    else:
        errstr = ('Repository    type    %s    not    supported' % reqtype)
        raise OfflineImapError(errstr, OfflineImapError.ERROR.REPO)
    config = account.getconfig()
    try:
        repostype = config.get(('Repository    ' + name), 'type').strip()
    except NoSectionError as e:
        errstr = ("Could    not    find    section    '%s'    in    configuration.    Required    for    account    '%s'." % (('Repository    %s' % name), account))
        six.reraise(OfflineImapError, OfflineImapError(errstr, OfflineImapError.ERROR.REPO), exc_info()[2])
    try:
        repo = typemap[repostype]
    except KeyError:
        errstr = ("'%s'    repository    not    supported    for    '%s'    repositories." % (repostype, reqtype))
        six.reraise(OfflineImapError, OfflineImapError(errstr, OfflineImapError.ERROR.REPO), exc_info()[2])
    return repo(name, account)
