-
-
Notifications
You must be signed in to change notification settings - Fork 658
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for Kleszczewo and Kostrzyn commune in Poland #2238
base: master
Are you sure you want to change the base?
Conversation
Update readme for zys_harmonogram
for row_index, row in enumerate(tree.findall(".//tr")): | ||
if row_index > 0: | ||
for cell_index, cell in enumerate(row.findall(".//td")): | ||
if cell_index > 0 and isinstance(cell.text, str): | ||
for day in cell.text.split(","): | ||
entries.append( | ||
Collection( | ||
datetime.date(year, row_index - 1, int(day)), | ||
NAME_MAP[cell_index], | ||
ICON_MAP[cell_index], | ||
) | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd highly prefer to prevent this deep nesting by inverting your if condition and continue (if row_index == 0): continue
Is Hard-coding the index to names map a good idea? Wouldn't it be better to just read the name from the th's of the first row?
..._components/waste_collection_schedule/waste_collection_schedule/source/zys_harmonogram_pl.py
Outdated
Show resolved
Hide resolved
bandit: |
…e defusedxml library. Improved request.get to use params arguments.
You're right, I changed the library to defusedxml.ElementTree. |
Add support for Kleszczewo and Kostrzyn commune in Poland