Adjustments

This commit is contained in:
Fred Boniface 2023-05-06 20:47:34 +01:00
parent ad4961bbe0
commit 556c09f8f6

View File

@ -16,16 +16,16 @@ def load(): # Programatically add a `toc` field to each entry.
## reverse the stops and store that. ## reverse the stops and store that.
def parse(codeList): def parse(codeList):
print(f"pis.parse: codeList starting length: {len(codeList)}") StartLen = len(codeList)
print(f"pis.parse: codeList starting length: {StartLen}")
for i in codeList: for i in codeList:
stops = i['stops'] stops = i['stops']
code = i['code'] code = i['code']
for ii in codeList: for ii in codeList:
if stops == ii['stops'] and code != ii['code']: if stops == ii['stops'] and code != ii['code']:
print("Identical stopping pattern found") print(f"Identical stopping pattern found: {ii['code']}")
print(ii)
codeList.remove(ii) codeList.remove(ii)
print(f"pis.parse: codeList finishing length: {len(codeList)}") print(f"pis.parse: Removed {StartLen - len(codeList)} duplicates")
return codeList return codeList
def devLoad(): # Programatically add a `toc` field to each entry. def devLoad(): # Programatically add a `toc` field to each entry.