def analyze_author_helper()

in crashclouseau/hgauthors.py [0:0]


def analyze_author_helper(author, first=False):
    """Analyze an author to try to guess the triple (email, realname, nickname)"""
    r = check_common(author)
    if r:
        return r

    r, fail = check_multiple(author)
    if fail:
        logger.error("Failed to parse authors: {}".format(author))
    if r:
        return r

    for special in [special1, special2, special3]:
        r = special(author)
        if r:
            return r

    if first:
        return None

    # maybe we've an encoding issue...
    for enc in ENCODINGS:
        try:
            a = bytes(author, enc).decode("utf-8")
            r = analyze_author_helper(a, first=True)
            if r:
                return r
            break
        except Exception:
            pass

    r = special5(author)
    if r:
        return r

    logger.error("Failed to parse author: {}".format(author))

    return None