Account for commas
All checks were successful
Build and Publish Jimmy.2 / build_and_publish (push) Successful in 7s
All checks were successful
Build and Publish Jimmy.2 / build_and_publish (push) Successful in 7s
This commit is contained in:
parent
03cf6c0780
commit
50381a11c3
1 changed files with 4 additions and 4 deletions
|
@ -13,7 +13,7 @@ from discord.ext import commands
|
||||||
|
|
||||||
|
|
||||||
SPAN_REGEX = re.compile(
|
SPAN_REGEX = re.compile(
|
||||||
r"^(?P<party>[a-zA-Z]+)\s(?P<councillors>\d+)\scouncillors\s(?P<net>\d+)\scouncillors\s(?P<net_change>(gained|lost))$"
|
r"^(?P<party>(\D+)(?P<councillors>[0-9,]+)\scouncillors\s(?P<net>[0-9,]+)\scouncillors\s(?P<net_change>(gained|lost))$"
|
||||||
)
|
)
|
||||||
MULTI: dict[str, int] = {
|
MULTI: dict[str, int] = {
|
||||||
"gained": 1,
|
"gained": 1,
|
||||||
|
@ -89,9 +89,9 @@ class ElectionCog(commands.Cog):
|
||||||
)
|
)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
results[str(groups["party"])] = [
|
results[str(groups["party"]).strip()] = [
|
||||||
int(groups["councillors"]),
|
int(groups["councillors"].strip().strip(",")),
|
||||||
int(groups["net"]) * MULTI[groups["net_change"]],
|
int(groups["net"].strip().strip(",")) * MULTI[groups["net_change"]],
|
||||||
int(find_colour(child_ul.next["class"][0])[1:], base=16)
|
int(find_colour(child_ul.next["class"][0])[1:], base=16)
|
||||||
]
|
]
|
||||||
return results
|
return results
|
||||||
|
|
Loading…
Reference in a new issue