Repository navigation
Closed
Description
DataProcessing/siteupdate/python-teresco/siteupdate.py
Lines 2058 to 2069 in b8af793
| # report any duplicate list names as errors | |
| if len(duplicate_list_names) > 0: | |
| print("Found " + str(len(duplicate_list_names)) + " DUPLICATE_LIST_NAME cases.") | |
| num_found = 0 | |
| for h in highway_systems: | |
| for r in h.route_list: | |
| if r.region + ' ' + r.list_entry_name() in duplicate_list_names: | |
| el.add_error("Duplicate list name: " + r.region + ' ' + r.list_entry_name()) | |
| num_found += 1 | |
| print("Added " + str(num_found) + " DUPLICATE_LIST_NAME error entries.") | |
| else: | |
| print("No duplicate list names found.") |
->
# report any duplicate list names as errors
if len(duplicate_list_names) > 0:
for d in duplicate_list_names:
el.add_error("Duplicate list name: " + d)
print("Added " + str(len(duplicate_list_names)) + " DUPLICATE_LIST_NAME error entries.")
else:
print("No duplicate list names found.")...would just add the duplicate list names straight to the ErrorList, without having to iterate thru highway_systems & their route_lists, or duplicate_list_names.
Rather than report duplicate .list names for every Route containing them, they're just reported once each.
Any reason not to do this?
Activity
jteresco commentedon Dec 4, 2018
Makes sense to me.