# Path: talon/signature/bruteforce.py
# RE_SIGNATURE = re.compile(r'''
#                (
#                    (?:
#                        ^[\s]*--*[\s]*[a-z \.]*$
#                        |
#                        ^thanks[\s,!]*$
#                        |
#                        ^regards[\s,!]*$
#                        |
#                        ^cheers[\s,!]*$
#                        |
#                        ^best[ a-z]*[\s,!]*$
#                    )
#                    .*
#                )
#                ''', re.I | re.X | re.M | re.S)
# RE_PHONE_SIGNATURE = re.compile(r'''
#                (
#                    (?:
#                        ^sent[ ]{1}from[ ]{1}my[\s,!\w]*$
#                        |
#                        ^sent[ ]from[ ]Mailbox[ ]for[ ]iPhone.*$
#                        |
#                        ^sent[ ]([\S]*[ ])?from[ ]my[ ]BlackBerry.*$
#                        |
#                        ^Enviado[ ]desde[ ]mi[ ]([\S]+[ ]){0,2}BlackBerry.*$
#                    )
#                    .*
#                )
#                ''', re.I | re.X | re.M | re.S)
# RE_SIGNATURE_CANDIDATE = re.compile(r'''
#     (?P<candidate>c+d)[^d]
#     |
#     (?P<candidate>c+d)$
#     |
#     (?P<candidate>c+)
#     |
#     (?P<candidate>d)[^d]
#     |
#     (?P<candidate>d)$
# ''', re.I | re.X | re.M | re.S)
# def extract_signature(msg_body):
# def get_signature_candidate(lines):
# def _mark_candidate_indexes(lines, candidate):
# def _process_marked_candidate_indexes(candidate, markers):


from .. import *
from talon.signature import bruteforce
            bruteforce._mark_candidate_indexes(
                ['BR,  ', 'long', 'Bob'],
                [0, 1, 2]))

        # only candidate lines are marked
        # if line has only dashes it's a candidate line
        eq_('ccdc',
            bruteforce._mark_candidate_indexes(
                ['-', 'long', '-', '- i', 'Bob'],
                [0, 2, 3, 4]))


def test_process_marked_candidate_indexes():
    eq_([2, 13, 15],
        bruteforce._process_marked_candidate_indexes(
            [2, 13, 15], 'dcc'))

    eq_([15],
        bruteforce._process_marked_candidate_indexes(
            [2, 13, 15], 'ddc'))

    eq_([13, 15],
        bruteforce._process_marked_candidate_indexes(
            [13, 15], 'cc'))

    eq_([15],
        bruteforce._process_marked_candidate_indexes(
            [15], 'lc'))

    eq_([15],

# Path: talon/signature/bruteforce.py
# RE_SIGNATURE = re.compile(r'''
#                (
#                    (?:
#                        ^[\s]*--*[\s]*[a-z \.]*$
#                        |
#                        ^thanks[\s,!]*$
#                        |
#                        ^regards[\s,!]*$
#                        |
#                        ^cheers[\s,!]*$
#                        |
#                        ^best[ a-z]*[\s,!]*$
#                    )
#                    .*
#                )
#                ''', re.I | re.X | re.M | re.S)
# RE_PHONE_SIGNATURE = re.compile(r'''
#                (
#                    (?:
#                        ^sent[ ]{1}from[ ]{1}my[\s,!\w]*$
#                        |
#                        ^sent[ ]from[ ]Mailbox[ ]for[ ]iPhone.*$
#                        |
#                        ^sent[ ]([\S]*[ ])?from[ ]my[ ]BlackBerry.*$
#                        |
#                        ^Enviado[ ]desde[ ]mi[ ]([\S]+[ ]){0,2}BlackBerry.*$
#                    )
#                    .*
#                )
#                ''', re.I | re.X | re.M | re.S)
# RE_SIGNATURE_CANDIDATE = re.compile(r'''
#     (?P<candidate>c+d)[^d]
#     |
#     (?P<candidate>c+d)$
#     |
#     (?P<candidate>c+)
#     |
#     (?P<candidate>d)[^d]
#     |
#     (?P<candidate>d)$
# ''', re.I | re.X | re.M | re.S)
# def extract_signature(msg_body):
# def get_signature_candidate(lines):
# def _mark_candidate_indexes(lines, candidate):
# def _process_marked_candidate_indexes(candidate, markers):


# Path: tests/signature/bruteforce_test.py
from .. import *
from talon.signature import bruteforce

            bruteforce._mark_candidate_indexes(
                ['BR,  ', 'long', 'Bob'],
                [0, 1, 2]))

        # only candidate lines are marked
        # if line has only dashes it's a candidate line
        eq_('ccdc',
            bruteforce._mark_candidate_indexes(
                ['-', 'long', '-', '- i', 'Bob'],
                [0, 2, 3, 4]))


def test_process_marked_candidate_indexes():
    eq_([2, 13, 15],
        bruteforce._process_marked_candidate_indexes(
            [2, 13, 15], 'dcc'))

    eq_([15],
        bruteforce._process_marked_candidate_indexes(
            [2, 13, 15], 'ddc'))

    eq_([13, 15],
        bruteforce._process_marked_candidate_indexes(
            [13, 15], 'cc'))

    eq_([15],
        bruteforce._process_marked_candidate_indexes(
            [15], 'lc'))

    eq_([15],

        bruteforce._process_marked_candidate_indexes(