forked from xieyumc/YuYuWechat
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGradioMain.py
More file actions
executable file
·57 lines (47 loc) · 2.43 KB
/
GradioMain.py
File metadata and controls
executable file
·57 lines (47 loc) · 2.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import gradio as gr
from SendMessageOnce import SendMessageOnce
import AutoSendMessage
with gr.Blocks(theme=gr.themes.Soft()) as demo:
with gr.Tab("发送一次信息"):
gr.Interface(
fn=SendMessageOnce,
inputs=[
gr.Textbox(label="Excel路径"),
gr.Textbox(label="表格页"),
gr.Textbox(label="好友名列"),
gr.Textbox(label="发送信息列"),
gr.Textbox(label="发送日期列"),
gr.Textbox(label="添加日期列"),
gr.Textbox(label="微信路径"),
gr.Dropdown(choices=["zh-CN", "zh-TW", "en-US"], label="微信语言", value="zh-CN")
],
outputs="text",
description="每次按下发送按钮,会从表格中筛选出日期符合的用户,立即发送信息给他们",
allow_flagging="never",
examples=[["C:\\Users\\Public\\Downloads\\Wechat.xlsx", "Sheet1", "A", "B", "C", "D",
"C:\\Program Files\\Tencent\\WeChat\\WeChat.exe", "zh-CN"]],
submit_btn="发送",
clear_btn="清空",
)
with gr.Tab("自动发送信息"):
gr.Interface(fn=AutoSendMessage.schedule_script_run,
inputs=[
gr.Textbox(label="Excel路径"),
gr.Textbox(label="表格页"),
gr.Textbox(label="好友名列"),
gr.Textbox(label="发送信息列"),
gr.Textbox(label="发送日期列"),
gr.Textbox(label="添加日期列"),
gr.Textbox(label="微信路径"),
gr.Dropdown(choices=["zh-CN", "zh-TW", "en-US"], label="微信语言", value="zh-CN"),
gr.Textbox(label="发送时间")
],
outputs="text",
allow_flagging="never",
description="每天在指定时间,会从表格中筛选出日期符合的用户,发送信息给他们",
examples=[["C:\\Users\\Public\\Downloads\\Wechat.xlsx", "Sheet1", "A", "B", "C", "D",
"C:\\Program Files\\Tencent\\WeChat\\WeChat.exe", "zh-CN", "09:00"]],
submit_btn="开始自动发送",
clear_btn="清空",
)
demo.launch(inbrowser=True,show_api=False)