From 4da3f245d1fec576f1f9f298cce53a5630545708 Mon Sep 17 00:00:00 2001 From: Cassius0924 <2670226747@qq.com> Date: Mon, 19 Feb 2024 21:27:06 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E9=A1=B9=E7=9B=AE=E5=90=AF=E5=8A=A8?= =?UTF-8?q?=E6=97=B6=E6=89=93=E5=8D=B0WeChatter=E8=89=BA=E6=9C=AF=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 10 ++++++++-- wechatter/__init__.py | 0 wechatter/app/app.py | 4 ++++ wechatter/art_text.py | 35 +++++++++++++++++++++++++++++++++++ 4 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 wechatter/__init__.py create mode 100644 wechatter/art_text.py 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)