def errorCheckUpd(vehiclesList, lookout=errorList, reportLog=errorReturnValue, count=errorCounter): ibcnumKey = "ibcnum" vehicleErrors = [] for vehicle in vehiclesList: errors = [] for key in lookout: if key == 'yearMakeModel': if catchJap(vehicle[key]): errors.append(f"This vehicle has {reportLog['jap_char']}") count[key].append(vehicle[ibcnumKey]) if key == 'yorImage': # fast search # if lookout[key] == getImageFileSize(vehicle[key]): if lookout[key] == vehicle[key]: # standard search count[key].append(vehicle[ibcnumKey]) errors.append(f"This vehicle has {reportLog[key]}") else: if lookout[key].lower() in vehicle[key].lower(): count[key].append(vehicle[ibcnumKey]) errors.append(f"This vehicle has {reportLog[key]}") if errors: vehicleErrors.append([vehicle[ibcnumKey]] + errors) # vehiclesList[-1]["ibcnum"][:-10] return vehicleErrors, count # , vehiclesList[-1]["ibcnum"][:-10]
def dataVerification(vehicles, lookout=errorList, moreLookOut=moreErrorList, reportLog=errorReturnValue): atnznumKey = "atnznum" shuppinKey = "shuppin" japanese = "jap_char" errorCount = error_init() for vehicle in vehicles: basic, advance = vehicle for key in lookout: if key == 'yearMakeModel': if catchJap(basic[key]): errorCount[japanese].append( (basic[atnznumKey], basic[shuppinKey])) # if key == 'main_img': # # fast search # main_img_size = getImageFileSize(basic[key]) # # if lookout[key] == main_img_size or 4484 == main_img_size: # if lookout[key] == main_img_size or noMainImg(main_img_size) or imgProcessed_moreImg(main_img_size): # # if lookout[key] == basic[key]: # standard search # errorCount[key].append( # (basic[atnznumKey], basic[shuppinKey])) # else: if key != 'main_img': # print(f"Key is {key}") if lookout[key].lower() in basic[key].lower(): errorCount[key].append( (basic[atnznumKey], basic[shuppinKey])) # for key in moreLookOut: # if key == 'more_images': # imagesList = advance[key] # for image in imagesList: # if isNoFoto(image) or noMainImg(image) or imgProcessed_moreImg(image): # errorCount[key].append( # (basic[atnznumKey], basic[shuppinKey])) # break # if key == 'auc_sheet': # auc_sheet_img = getImageFileSize(advance[key]) # if isAucSheetIncomplete(auc_sheet_img) or isNoFotoHref(auc_sheet_img) or imgProcessedBlank(auc_sheet_img): # errorCount[key].append( # (basic[atnznumKey], basic[shuppinKey])) # break return errorCount
def dataVerification(vehicles, lookout=errorList, moreLookOut=moreErrorList, reportLog=errorReturnValue): ibcnumKey = "ibcnum" shuppinKey = "shuppin" japanese = "jap_char" errorCount = error_init() for vehicle in vehicles: basic, advance = vehicle for key in lookout: if key == 'yearMakeModel': if catchJap(basic[key]): errorCount[japanese].append( (basic[ibcnumKey], basic[shuppinKey])) # if key == 'yorImage' or key == 'main_img': # # fast search # if lookout[key] == getImageFileSize(basic[key]): # # if lookout[key] == basic[key]: # standard search # errorCount[key].append( # (basic[ibcnumKey], basic[shuppinKey])) # else: if key != 'yorImage' and key != 'main_img': # print(f"Key is {key}") if lookout[key].lower() in basic[key].lower(): errorCount[key].append( (basic[ibcnumKey], basic[shuppinKey])) # for key in moreLookOut: # if key == 'more_images': # imagesList = advance[key] # for image in imagesList: # if isNoFoto(image): # errorCount[key].append( # (basic[ibcnumKey], basic[shuppinKey])) # break # if key == 'auc_sheet': # # if isAucSheetIncomplete(advance[key]): # if isAucSheetIncomplete(getImageFileSize(advance[key])): # errorCount[key].append( # (basic[ibcnumKey], basic[shuppinKey])) # break return errorCount
def errorCheckMoreInfo(vehiclesList, detailedList, lookout=errorList, moreLookOut=moreErrorList, reportLog=errorReturnValue): ibcnumKey = "ibcnum" shuppinKey = "shuppin" errorCount = error_init() for vehicle, detail in zip(vehiclesList, detailedList): for key in lookout: if key == 'yearMakeModel': if catchJap(vehicle[key]): errorCount[key].append( (vehicle[ibcnumKey], vehicle[shuppinKey])) if key == 'yorImage' or key == 'main_img': # fast search # if lookout[key] == getImageFileSize(vehicle[key]): if lookout[key] == vehicle[key]: # standard search errorCount[key].append( (vehicle[ibcnumKey], vehicle[shuppinKey])) else: if lookout[key].lower() in vehicle[key].lower(): errorCount[key].append( (vehicle[ibcnumKey], vehicle[shuppinKey])) for key in moreLookOut: if key == 'more_images': imagesList = detail[key] for image in imagesList: if isNoFoto(image): errorCount[key].append( (vehicle[ibcnumKey], vehicle[shuppinKey])) break # if key == 'auc_sheet': # if isAucSheetIncomplete(detail[key]): # errorCount[key].append( # (vehicle[ibcnumKey], vehicle[shuppinKey])) return errorCount # , vehiclesList[-1]["ibcnum"][:-10]
def errorCheck_ibc_shuppin(vehiclesList, lookout=errorList, reportLog=errorReturnValue): ibcnumKey = "ibcnum" shuppinKey = "shuppin" errorCount = error_init() for vehicle in vehiclesList: for key in lookout: if key == 'yearMakeModel': if catchJap(vehicle[key]): errorCount[key].append( (vehicle[ibcnumKey], vehicle[shuppinKey])) if key == 'yorImage': # fast search # if lookout[key] == getImageFileSize(vehicle[key]): if lookout[key] == vehicle[key]: # standard search errorCount[key].append( (vehicle[ibcnumKey], vehicle[shuppinKey])) else: if lookout[key].lower() in vehicle[key].lower(): errorCount[key].append( (vehicle[ibcnumKey], vehicle[shuppinKey])) return errorCount # , vehiclesList[-1]["ibcnum"][:-10]