def found_read(obtained_epc, obtained_lines): “”” Reading of epcs found in the location and file. :param obtained_epc: :param obtained_lines: :return found_list: “”” found = set(obtained_lines).union(set(obtained_epc)) found_list = list(found) return found_list
def operation_file_counted(audit_id): “”” Complete audit operation. :param audit_id: :return line,epc_read,epc_found,epc_not_found,epc_extra: “”” audit = Audit.objects.get(pk=audit_id) epc_file = lines_read(audit_id) epc_read_expected = expected_read(location=audit.location) epc_found = found_read(epc_read_expected, epc_file) epc_not_found = not_found_read(epc_file, epc_read_expected) epc_extra = extras_read(epc_file, epc_read_expected)
audit.total_counted = len(epc_file) audit.total_expected = len(epc_read_expected) audit.total_found = len(epc_found) audit.total_not_found = len(epc_not_found) audit.total_extra = len(epc_extra) audit.save()