| defmatch(self,fpentry): |
| """Check if the fpentry from the csv file matches in all fields""" |
| # quick and easy checks first |
| ifself.route.root!=fpentry[0] orself.code!=fpentry[4]: |
| returnFalse |
| # now label matches |
| iflen(self.labels) >0andself.labels[0] !=fpentry[1]: |
| returnFalse |
| iflen(self.labels) >1andself.labels[1] !=fpentry[2]: |
| returnFalse |
| iflen(self.labels) >2andself.labels[2] !=fpentry[3]: |
| returnFalse |
| # finally make sure info matches if we got this far |
| returnself.info==fpentry[5] |
| |
| defmatch_except_info(self,fpentry): |
| """Check if the fpentry from the csv file matches in all fields |
| except the info field""" |
| # quick and easy checks first |
| ifself.route.root!=fpentry[0] orself.code!=fpentry[4]: |
| returnFalse |
| # now label matches |
| iflen(self.labels) >0andself.labels[0] !=fpentry[1]: |
| returnFalse |
| iflen(self.labels) >1andself.labels[1] !=fpentry[2]: |
| returnFalse |
| iflen(self.labels) >2andself.labels[2] !=fpentry[3]: |
| returnFalse |
| # call it a match except info if the info does not match |
| returnself.info!=fpentry[5] |
Proposed:defmatch_except_info(self,fpentry):
"""Check if the fpentry from the csv file matches in all fields except the info field"""# quick and easy checks firstifself.route.root!=fpentry[0] orself.code!=fpentry[4]:
returnFalse# now label matchesiflen(self.labels) >0andself.labels[0] !=fpentry[1]:
returnFalseiflen(self.labels) >1andself.labels[1] !=fpentry[2]:
returnFalseiflen(self.labels) >2andself.labels[2] !=fpentry[3]:
returnFalsereturnTruedefmatch_info(self,fpentry):
returnself.info==fpentry[5]
| forfpindatacheckfps: |
| #print("Comparing: " + str(d) + " to " + str(fp)) |
| ifd.match(fp): |
| #print("Match!") |
| d.fp=True |
| toremove.append(fp) |
| break |
| ifd.match_except_info(fp): |
| fpfile.write("FP_ENTRY: "+fp[0] +';'+fp[1] +';'+fp[2] +';'+fp[3] +';'+fp[4] +';'+fp[5] +'\n') |
| fpfile.write("CHANGETO: "+fp[0] +';'+fp[1] +';'+fp[2] +';'+fp[3] +';'+fp[4] +';'+d.info+'\n') |
Proposed:forfpindatacheckfps:
#print("Comparing: " + str(d) + " to " + str(fp))ifd.match_except_info(fp):
ifd.match_info(fp):
#print("Match!")d.fp=Truetoremove.append(fp)
breakelse:
fpfile.write("FP_ENTRY: "+fp[0] +';'+fp[1] +';'+fp[2] +';'+fp[3] +';'+fp[4] +';'+fp[5] +'\n')
fpfile.write("CHANGETO: "+fp[0] +';'+fp[1] +';'+fp[2] +';'+fp[3] +';'+fp[4] +';'+d.info+'\n')
DataProcessing/siteupdate/python-teresco/siteupdate.py
Lines 1158 to 1187 in 18f3a08
Proposed:
DataProcessing/siteupdate/python-teresco/siteupdate.py
Lines 3281 to 3290 in 18f3a08
Proposed: