def get_line_objs()

in src/choose.py [0:0]


def get_line_objs() -> Dict[int, LineBase]:
    file_path = state_files.get_pickle_file_path()
    try:
        line_objs: Dict[int, LineBase] = pickle.load(open(file_path, "rb"))
    except (OSError, KeyError, pickle.PickleError):
        output.append_error(LOAD_SELECTION_WARNING)
        output.append_exit()
        sys.exit(1)
    logger.add_event("total_num_files", len(line_objs))

    selection_path = state_files.get_selection_file_path()
    if os.path.isfile(selection_path):
        set_selections_from_pickle(selection_path, line_objs)

    matches = [
        line_obj for line_obj in line_objs.values() if isinstance(line_obj, LineMatch)
    ]
    if not matches:
        output.write_to_file('echo "No lines matched!";')
        output.append_exit()
        sys.exit(0)
    return line_objs