This repository has been archived by the owner on Jan 18, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(constants): split constants.py into multiple files for bette…
…r organization
- Loading branch information
Showing
3 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from typing import LiteralString | ||
|
||
CONFIG_PATHS: list[LiteralString] = [ | ||
"config.json", | ||
"check-phat-nguoi.config.json", | ||
"~/check-phat-nguoi.config.json", | ||
] | ||
SIMPLE_LOG_MESSAGE: LiteralString = "[%(levelname)s]: %(message)s" | ||
DETAIL_LOG_MESSAGE: LiteralString = ( | ||
"%(asctime)s [%(levelname)s] - %(message)s (%(filename)s:%(lineno)d)" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from typing import LiteralString | ||
|
||
# API from checkphatnguoi.vn | ||
GET_DATA_API_URL_CHECKPHATNGUOI: LiteralString = ( | ||
"https://api.checkphatnguoi.vn/phatnguoi" | ||
) | ||
SEND_MESSAGE_API_URL_TELEGRAM: LiteralString = ( | ||
"https://api.telegram.org/bot{bot_token}/sendMessage" | ||
) | ||
DATETIME_FORMAT_CHECKPHATNGUOI: LiteralString = "%H:%M, %d/%m/%Y" | ||
|
||
OFFICE_NAME_PATTERN = r"^\d+\." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
from typing import LiteralString | ||
|
||
SEND_MESSAGE_API_URL_TELEGRAM: LiteralString = ( | ||
"https://api.telegram.org/bot{bot_token}/sendMessage" | ||
) | ||
MESSAGE_MARKDOWN_PATTERN: LiteralString = """ | ||
*🚗 **Thông tin phương tiện**:* | ||
- **Biển kiểm soát:** `{plate}` | ||
- **Chủ sở hữu:** `{owner}' | ||
*⚠️ **Thông tin vi phạm**:* | ||
- **Hành vi vi phạm:** `{action}` | ||
- **Trạng thái:** {status} | ||
- **Thời gian vi phạm:** `{date}` | ||
- **Địa điểm vi phạm** {location} | ||
*🏢 **Đơn vị phát hiện vi phạm**:* | ||
- **{enforcement_unit}** | ||
*📍 **Nơi giải quyết vụ việc**:* | ||
{resolution_locations} | ||
""" | ||
|
||
RESOLUTION_LOCATION_MARKDOWN_PATTERN: LiteralString = """ | ||
{idx}. **{location_name} | ||
- **Địa chỉ:** {address} | ||
- **Số điện thoại liên lạc:** {phone} | ||
""" |