mirror of
https://github.com/quatalog/quatalog.git
synced 2024-09-27 12:08:46 +00:00
Compare commits
3 commits
9c374bf130
...
0f3652d8cc
Author | SHA1 | Date | |
---|---|---|---|
0f3652d8cc | |||
7c87221256 | |||
69d8946f37 |
|
@ -232,9 +232,12 @@ def parse_course_td(td, note=None):
|
||||||
cr_delim = (
|
cr_delim = (
|
||||||
len(course_info)
|
len(course_info)
|
||||||
- 1
|
- 1
|
||||||
- list(bool(re.search(r"\(", s)) for s in course_info[::-1]).index(True)
|
- list(
|
||||||
|
bool(re.search(r"^\([0-9]", s.strip())) for s in course_info[::-1]
|
||||||
|
).index(True)
|
||||||
)
|
)
|
||||||
except ValueError:
|
assert bool(re.search(r"[0-9]\)", course_info[-1]))
|
||||||
|
except (ValueError, AssertionError):
|
||||||
cr_delim = len(course_info)
|
cr_delim = len(course_info)
|
||||||
|
|
||||||
# note serves as a credit count override, since the RPI-side credit counts
|
# note serves as a credit count override, since the RPI-side credit counts
|
||||||
|
@ -245,7 +248,7 @@ def parse_course_td(td, note=None):
|
||||||
"catalog": td.find_element(By.TAG_NAME, "span").text,
|
"catalog": td.find_element(By.TAG_NAME, "span").text,
|
||||||
}
|
}
|
||||||
if note is None:
|
if note is None:
|
||||||
out.update({"credits": str(" ".join(course_info[cr_delim:])[1:-1])}),
|
out.update({"credits": str(" ".join(course_info[cr_delim:])[1:-1]).strip()}),
|
||||||
return out
|
return out
|
||||||
else:
|
else:
|
||||||
out.update({"note": note})
|
out.update({"note": note})
|
||||||
|
|
Loading…
Reference in a new issue