示例#1
0
def multi_page_legal(browser, legal_table, document, number_pages):
    legal_data = drop_last_line(
        title_strip(join_column_without_title(legal_table)))
    for current_page in range(number_pages - 1):
        next_legal_table(legal_table, document, (current_page + 2))
        legal_table = get_legal_table(browser)
        legal_data = f'{legal_data}\n{drop_last_line(title_strip(join_column_without_title(legal_table)))}'
示例#2
0
def record_document_type_and_number(browser, abstract, document):
    document_type, reception_number = access_document_type_and_number(
        browser, abstract, document)
    document.reception_number = reception_number
    record_value(abstract, 'document type',
                 update_sentence_case_extras(title_strip(document_type)))
    handle_reception_number(abstract, document)
示例#3
0
def record_document_type(general_information, dictionary):
    document_type = check_list_elements(general_information,
                                        row_titles["document_type"])
    if document_type == not_applicable or document_type in bad_document_types:
        document_type = check_list_elements(general_information,
                                            row_titles["alt_document_type"])
    dictionary["Document Type"].append(title_strip(document_type))
示例#4
0
def prepare_name_search():
    name = title_strip(search_name)
    if name == '':
        name = request_new_name()
    while request_yes_or_no(f'The current name to be searched is "{name}", is this correct?') is False:
        clear_terminal()
        name = request_new_name()
    clear_terminal()
    return Document(type="name", value=name)
示例#5
0
def access_field_value(browser, document, id, field_type):
    field = locate_element_by_id(browser, id, field_type, document=document)
    if field_type.endswith('date'):
        return date_from_string(get_field_value(field).split(' ')[0])
    elif field_type == 'document type':
        return update_sentence_case_extras(title_strip(get_field_value(field)))
    else:
        if field_type == 'reception number':
            document.reception_number = get_field_value(field)
        return get_field_value(field)
示例#6
0
def record_date(row, dataframe, document, type):
    date = access_date(title_strip(row), document, type)
    dataframe[f'{type.title()} Date'].append(date)
示例#7
0
def record_legal(abstract, document_table, document):
    legal = title_strip(document_table.text)
    record_value(abstract, 'legal', legal)
示例#8
0
def record_grantee(abstract, rows):
    grantee = check_rows(abstract, rows,
                         abstract.county.titles["Row Titles"]["grantee"])
    record_value(abstract, 'grantee', title_strip(grantee))
示例#9
0
def record_document_type(abstract, rows):
    document_type = check_rows(
        abstract, rows, abstract.county.titles["Row Titles"]["document_type"])
    record_value(abstract, 'document type', title_strip(document_type))
示例#10
0
def record_grantee_information(browser, dictionary, document):
    grantee_table = locate_document_table(browser, document, grantee_id,
                                          "grantee")
    grantee = title_strip(join_column_without_title(grantee_table))
    dictionary["Grantee"].append(drop_hyphen(grantee))
示例#11
0
def handle_legal_tables(browser, legal_table, document):
    number_pages = get_number_legal_pages(legal_table)
    if number_pages == 1:
        return title_strip(join_column_without_title(legal_table))
    else:
        return multi_page_legal(browser, legal_table, document, number_pages)