diff --git a/main.py b/main.py index f736a30..8ed7d39 100644 --- a/main.py +++ b/main.py @@ -1,6 +1,13 @@ # WeChatter 启动文件 +# +# __ __ ______ ______ __ __ ______ ______ ______ ______ ______ +# /\ \ _ \ \ /\ ___\ /\ ___\ /\ \_\ \ /\ __ \ /\__ _\/\__ _\/\ ___\ /\ == \ +# \ \ \/ ".\ \\ \ __\ \ \ \____\ \ __ \\ \ __ \\/_/\ \/\/_/\ \/\ \ __\ \ \ __< +# \ \__/".~\_\\ \_____\\ \_____\\ \_\ \_\\ \_\ \_\ \ \_\ \ \_\ \ \_____\\ \_\ \_\ +# \/_/ \/_/ \/_____/ \/_____/ \/_/\/_/ \/_/\/_/ \/_/ \/_/ \/_____/ \/_/ /_/ +# + import uvicorn -from loguru import logger import wechatter.database as db import wechatter.utils.file_manager as fm @@ -28,7 +35,6 @@ def main(): db.create_tables() - logger.info("WeChatter 启动成功!") # 启动uvicorn uvicorn.run(app, host="0.0.0.0", port=config.wechatter_port) diff --git a/wechatter/__init__.py b/wechatter/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/wechatter/app/app.py b/wechatter/app/app.py index b9bbbb5..d81d6d7 100644 --- a/wechatter/app/app.py +++ b/wechatter/app/app.py @@ -1,7 +1,9 @@ from fastapi import FastAPI +from loguru import logger import wechatter.app.routers as routers import wechatter.config as config +from wechatter.art_text import print_wechatter_art_text from wechatter.config.parsers import ( parse_gasoline_price_cron_rule_list, parse_weather_cron_rule_list, @@ -33,6 +35,8 @@ @app.on_event("startup") async def startup_event(): scheduler.startup() + print_wechatter_art_text() + logger.info("WeChatter 启动成功!") @app.on_event("shutdown") async def shutdown_event(): diff --git a/wechatter/art_text.py b/wechatter/art_text.py new file mode 100644 index 0000000..415bea1 --- /dev/null +++ b/wechatter/art_text.py @@ -0,0 +1,35 @@ +# WECHATTER_ART_TEXT0 = r'+-------------------------------------------------------------------------------------+' +# WECHATTER_ART_TEXT1 = r'| __ __ ______ ______ __ __ ______ ______ ______ ______ ______ |' +# WECHATTER_ART_TEXT2 = r'| /\ \ _ \ \ /\ ___\ /\ ___\ /\ \_\ \ /\ __ \ /\__ _\/\__ _\/\ ___\ /\ == \ |' +# WECHATTER_ART_TEXT3 = r'| \ \ \/ ".\ \\ \ __\ \ \ \____\ \ __ \\ \ __ \\/_/\ \/\/_/\ \/\ \ __\ \ \ __< |' +# WECHATTER_ART_TEXT4 = r'| \ \__/".~\_\\ \_____\\ \_____\\ \_\ \_\\ \_\ \_\ \ \_\ \ \_\ \ \_____\\ \_\ \_\ |' +# WECHATTER_ART_TEXT5 = r'| \/_/ \/_/ \/_____/ \/_____/ \/_/\/_/ \/_/\/_/ \/_/ \/_/ \/_____/ \/_/ /_/ |' +# WECHATTER_ART_TEXT6 = r'+-------------------------------------------------------------------------------------+' + +WECHATTER_ART_TEXT = r""" + __ __ ______ ______ __ __ ______ ______ ______ ______ ______ + /\ \ _ \ \ /\ ___\ /\ ___\ /\ \_\ \ /\ __ \ /\__ _\/\__ _\/\ ___\ /\ == \ + \ \ \/ ".\ \\ \ __\ \ \ \____\ \ __ \\ \ __ \\/_/\ \/\/_/\ \/\ \ __\ \ \ __< + \ \__/".~\_\\ \_____\\ \_____\\ \_\ \_\\ \_\ \_\ \ \_\ \ \_\ \ \_____\\ \_\ \_\ + \/_/ \/_/ \/_____/ \/_____/ \/_/\/_/ \/_/\/_/ \/_/ \/_/ \/_____/ \/_/ /_/ +""" + + +def print_wechatter_art_text(): + print(WECHATTER_ART_TEXT) + + +# print(WECHATTER_ART_TEXT0) +# print(WECHATTER_ART_TEXT1) +# print(WECHATTER_ART_TEXT2) +# print(WECHATTER_ART_TEXT3) +# print(WECHATTER_ART_TEXT4) +# print(WECHATTER_ART_TEXT5) +# print(WECHATTER_ART_TEXT6) +# print("\033[1;36m%s\033[0m" % WECHATTER_ART_TEXT0) +# print("\033[1;36m%s\033[0m" % WECHATTER_ART_TEXT1) +# print("\033[1;36m%s\033[0m" % WECHATTER_ART_TEXT2) +# print("\033[1;31m%s\033[0m" % WECHATTER_ART_TEXT3) +# print("\033[1;34m%s\033[0m" % WECHATTER_ART_TEXT4) +# print("\033[1;34m%s\033[0m" % WECHATTER_ART_TEXT5) +# print("\033[1;34m%s\033[0m" % WECHATTER_ART_TEXT6)