Skip to content
This repository has been archived by the owner on Jan 18, 2025. It is now read-only.

Commit

Permalink
chore: use f'string for all and check None instead empty list(because…
Browse files Browse the repository at this point in the history
… those are the same)
  • Loading branch information
NTGNguyen committed Jan 14, 2025
1 parent 10ff28b commit 00fa994
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/check_phat_nguoi/get_data/engines/phat_nguoi.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def __init__(self) -> None:
def get_violations(html: str):
soup = BeautifulSoup(html, "html.parser")
violation_htmls: ResultSet[BeautifulSoup] = soup.find_all("tbody")
if violation_htmls == []:
if violation_htmls is None:
return
violation_detail_set: set[ViolationDetail] = set()

Expand Down Expand Up @@ -72,10 +72,8 @@ def _get_violation(violation_html: BeautifulSoup):
return tuple(violation_detail_set)

async def _request(self, plate_info: PlateInfo) -> str | None:
url = (
API_URL_PHATNGUOI
+ plate_info.plate
+ f"/{get_vehicle_enum(plate_info.type)}/"
url: str = (
f"{API_URL_PHATNGUOI}{plate_info.plate}/{get_vehicle_enum(plate_info.type)}"
)
try:
async with self._session.get(url=url) as response:
Expand Down

0 comments on commit 00fa994

Please sign in to comment.