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.
feat: add option havent_paid_only, detail_log
- Loading branch information
1 parent
870a351
commit 0fc3d1b
Showing
8 changed files
with
27 additions
and
5 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
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 |
---|---|---|
@@ -1 +1 @@ | ||
{"$defs": {"LogLevel": {"enum": ["NOTSET", "DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"], "title": "LogLevel", "type": "string"}, "PlateInfo": {"properties": {"plate": {"title": "Plate", "type": "string"}, "owner": {"anyOf": [{"type": "string"}, {"type": "null"}], "default": null, "title": "Owner"}}, "required": ["plate"], "title": "PlateInfo", "type": "object"}, "Telegram": {"properties": {"bot_token": {"title": "Bot Token", "type": "string"}, "chat_id": {"title": "Chat Id", "type": "string"}}, "required": ["bot_token", "chat_id"], "title": "Telegram", "type": "object"}, "TelegramNotify": {"properties": {"telegram": {"$ref": "#/$defs/Telegram"}}, "required": ["telegram"], "title": "TelegramNotify", "type": "object"}}, "properties": {"data": {"default": [], "items": {"$ref": "#/$defs/PlateInfo"}, "title": "Data", "type": "array"}, "notify": {"default": [], "items": {"$ref": "#/$defs/TelegramNotify"}, "title": "Notify", "type": "array"}, "log_level": {"$ref": "#/$defs/LogLevel", "default": "WARNING"}}, "title": "Config", "type": "object"} | ||
{"$defs": {"LogLevel": {"enum": ["NOTSET", "DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"], "title": "LogLevel", "type": "string"}, "PlateInfo": {"properties": {"plate": {"title": "Plate", "type": "string"}, "owner": {"anyOf": [{"type": "string"}, {"type": "null"}], "default": null, "title": "Owner"}}, "required": ["plate"], "title": "PlateInfo", "type": "object"}, "Telegram": {"properties": {"bot_token": {"title": "Bot Token", "type": "string"}, "chat_id": {"title": "Chat Id", "type": "string"}}, "required": ["bot_token", "chat_id"], "title": "Telegram", "type": "object"}, "TelegramNotify": {"properties": {"telegram": {"$ref": "#/$defs/Telegram"}}, "required": ["telegram"], "title": "TelegramNotify", "type": "object"}}, "properties": {"data": {"default": [], "items": {"$ref": "#/$defs/PlateInfo"}, "title": "Data", "type": "array"}, "notify": {"default": [], "items": {"$ref": "#/$defs/TelegramNotify"}, "title": "Notify", "type": "array"}, "havent_paid_only": {"default": true, "title": "Havent Paid Only", "type": "boolean"}, "detail_log": {"default": false, "title": "Detail Log", "type": "boolean"}, "log_level": {"$ref": "#/$defs/LogLevel", "default": "WARNING"}}, "title": "Config", "type": "object"} |
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 |
---|---|---|
@@ -1,10 +1,14 @@ | ||
from logging import Logger, getLogger | ||
|
||
from check_phat_nguoi.modules.config_reader import config | ||
from check_phat_nguoi.modules.logger import setup_logger | ||
|
||
logger: Logger = getLogger(__name__) | ||
|
||
|
||
def main() -> None: | ||
setup_logger() | ||
print(config) | ||
logger.debug(config) | ||
|
||
|
||
__all__ = ["main"] |
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
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
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
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
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 |
---|---|---|
@@ -1,2 +1,6 @@ | ||
URL: str = "https://api.checkphatnguoi.vn/phatnguoi" | ||
CONFIG_PATH: str = "config.json" | ||
SIMPLE_LOG_MESSAGE: str = "[%(levelname)s]: %(message)s" | ||
DETAIL_LOG_MESSAGE: str = ( | ||
"%(asctime)s [%(levelname)s] - %(message)s (%(filename)s:%(lineno)d)" | ||
) |