Skip to content

Commit

Permalink
🚅 perfs: new datetime format
Browse files Browse the repository at this point in the history
  • Loading branch information
Akisaira committed Sep 21, 2022
1 parent 60fa476 commit 519b47a
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from watchdog.observers import Observer
from LskyApis import LskyApis
from NewPicsHandler import NewPicsHandler
from classes.LskyApis import LskyApis
from classes.NewPicsHandler import NewPicsHandler
from MyQR import myqr
from Silence import Silence
from classes.Silence import Silence
from dotenv import load_dotenv
import logging
import os
Expand All @@ -15,6 +15,7 @@
# 日志输出设置
logging.basicConfig(
level=logging.INFO,
datefmt="%m/%d %H:%M:%S",
format='%(asctime)s [%(levelname)s]: %(message)s'
)

Expand Down Expand Up @@ -54,16 +55,17 @@ def qr_gen(path):
save_name=img_info["name"] + "_qr.png",
save_dir=QR_DIR
)
logging.info("二维码已保存至" + img_info["name"] + "qr.png")
logging.info("二维码已保存至" + img_info["name"] + "_qr.png")
try:
os.startfile(QR_DIR + "\\" + img_info["name"] + "qr.png")
os.startfile(QR_DIR + "\\" + img_info["name"] + "_qr.png")
except:
raise Exception("尝试打开二维码文件时发生错误")


# 创建并启动Observer线程
ob = Observer()
ob.schedule(NewPicsHandler(qr_gen), OBSERVED_DIR)
logging.info("已启动")
ob.start()

try:
Expand Down

0 comments on commit 519b47a

Please sign in to comment.