Skip to content

Commit

Permalink
Use AnyStr instead of str | bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
madeddie committed May 13, 2024
1 parent 83a9c0e commit 14faf25
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions moocfi_cses.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ class Task:


# TODO: this should be part of a client class or module
def parse_task_list(html: str | bytes) -> list[Task]:
def parse_task_list(html: AnyStr) -> list[Task]:
"""Parse html to find tasks and their status, return something useful, possibly a specific data class"""
content_element = htmlement.fromstring(html).find('.//div[@class="content"]')
task_list = list()
Expand Down Expand Up @@ -317,7 +317,7 @@ def print_task_list(

# TODO: Implement function that parser the specific task page into Task object
# TODO: should we split up this function in a bunch of smaller ones? or will beautifulsoup make it simpler?
def parse_task(html: str | bytes) -> Task:
def parse_task(html: AnyStr) -> Task:
root = htmlement.fromstring(html)
task_link_element = root.find('.//div[@class="nav sidebar"]/a')
task_link = task_link_element if task_link_element is not None else Element("a")
Expand Down

0 comments on commit 14faf25

Please sign in to comment.