✨✨ 新增消息集合推送
This commit is contained in:
parent
961d43fb37
commit
bda28e00ae
23
fn_print.py
Normal file
23
fn_print.py
Normal file
@ -0,0 +1,23 @@
|
||||
# -*- coding=UTF-8 -*-
|
||||
# @Project QL_TimingScript
|
||||
# @fileName fn_print.py
|
||||
# @author Echo
|
||||
# @EditTime 2024/9/24
|
||||
from typing import *
|
||||
|
||||
all_print_list = []
|
||||
|
||||
|
||||
def fn_print(*args, sep=' ', end='\n', **kwargs):
|
||||
global all_print_list
|
||||
output = ""
|
||||
# 构建输出字符串
|
||||
for index, arg in enumerate(args):
|
||||
if index == len(args) - 1:
|
||||
output += str(arg)
|
||||
continue
|
||||
output += str(arg) + sep
|
||||
output = output + end
|
||||
all_print_list.append(output)
|
||||
# 调用内置的 print 函数打印字符串
|
||||
print(*args, sep=sep, end=end, **kwargs)
|
||||
@ -3,7 +3,6 @@
|
||||
# @fileName sendNotify.py
|
||||
# @author Echo
|
||||
# @EditTime 2024/9/13
|
||||
from curses.ascii import FS
|
||||
import sys
|
||||
import os, re
|
||||
import requests
|
||||
@ -16,6 +15,8 @@ import urllib.parse
|
||||
from requests.adapters import HTTPAdapter
|
||||
from urllib3.util import Retry
|
||||
|
||||
from fn_print import all_print_list
|
||||
|
||||
cur_path = os.path.abspath(os.path.dirname(__file__))
|
||||
root_path = os.path.split(cur_path)[0]
|
||||
sys.path.append(root_path)
|
||||
@ -465,7 +466,6 @@ def send(title, content):
|
||||
continue
|
||||
else:
|
||||
print('此类推送方式不存在')
|
||||
print("xxxxxxxxxxxx")
|
||||
|
||||
|
||||
def main():
|
||||
@ -479,6 +479,14 @@ def send_notification_message(title, content):
|
||||
print("发送通知消息失败")
|
||||
|
||||
|
||||
def send_notification_message_collection(title):
|
||||
try:
|
||||
send(title, ''.join(all_print_list))
|
||||
except Exception as e:
|
||||
if e:
|
||||
print('发送通知消息失败!')
|
||||
|
||||
|
||||
async def aysnc_send_notification_message(title, content):
|
||||
try:
|
||||
timestamp = str(round(time.time() * 1000)) # 时间戳
|
||||
|
||||
Loading…
Reference in New Issue
Block a user