Download settings.py from pengyuyan1222/instock_warning_GUI_cloud: direct link, hf CLI and curl.
- Browser
- Download file 4.04 kB
-
https://huggingface.co/spaces/pengyuyan1222/instock_warning_GUI_cloud/resolve/main/settings.py
- Command line
-
hf download hf://spaces/pengyuyan1222/instock_warning_GUI_cloud/settings.py
-
curl -L -o settings.py https://huggingface.co/spaces/pengyuyan1222/instock_warning_GUI_cloud/resolve/main/settings.py
4.04 kB
| # 1.数据库连接信息 | |
| user = 'jz002' | |
| host = 'rm-wz9dh38emx9o7w0jnmo.mysql.rds.aliyuncs.com' | |
| password = 'Shokz@2022' | |
| database = 'db_intl_sales_bi' | |
| port = 3306 | |
| # 2.库存预警模型文件路径 | |
| file_path_model_UK_FR = r'D:/OneDrive/库存预警模型 - 英国&法国.xlsx' | |
| file_path_model_AU_JP = r'D:/OneDrive/库存预警模型 - 澳洲&日本.xlsx' | |
| # 3.1.库存预警模型文件路径 & 子表名 -- for lack_of_stock_SKU_count 函数 | |
| file_path_model_target_sheet = { | |
| file_path_model_UK_FR: ['英国','法国'], | |
| file_path_model_AU_JP: ['澳洲','日本'] | |
| } | |
| # 3.2.库存预警模型名称&云端URL -- for email_body_write 函数 | |
| model_url_dict = { | |
| 'UK&FR库存预警模型':'https://1drv.ms/x/c/89815abf98f215d9/EXqi4EjEEk1DvZIbHf-G__4BK42F7vf_ZFf9tu3FLD5gNQ?e=1uHDpU', | |
| 'AU&JP库存预警模型':'https://1drv.ms/x/c/89815abf98f215d9/EcP-cHJ23uVBjd3T1rdOtJIBaUJOXYATlDZDnucWByoivw?e=oQi9GK' | |
| } | |
| # 3.3.邮件发送参数 | |
| from datetime import datetime | |
| warning_date = datetime.now().date() | |
| email_content_dict = { | |
| 'subject' : f'官网库存预警-{warning_date}', | |
| 'to_recipients' : 'eddie@shokz.com;', | |
| 'cc_recipients' : 'eddie@shokz.com;' | |
| } | |
| # 4.Gradio样式设置 | |
| custom_css = """ | |
| #title { | |
| background-color: #8B0000; | |
| color: white; | |
| padding: 15px; | |
| text-align: center; | |
| font-size: 24px; | |
| font-weight: bold; | |
| border-radius: 10px; | |
| } | |
| #container { | |
| display: flex; | |
| justify-content: space-between; | |
| } | |
| #input_section { | |
| width: 48%; | |
| padding: 10px; | |
| background: #f8f8f8; | |
| border-radius: 10px; | |
| } | |
| #output_section { | |
| width: 48%; | |
| padding: 10px; | |
| background: #f8f8f8; | |
| border-radius: 10px; | |
| } | |
| #start-warning-button { | |
| margin-top: 20px; | |
| text-align: center; | |
| width: 100%; | |
| background-color: darkred; | |
| color: white; | |
| font-weight: bold; | |
| } | |
| """ | |
| # custom_css = """ | |
| # #title { | |
| # background-color: #8B0000; | |
| # color: white; | |
| # padding: 15px; | |
| # text-align: center; | |
| # font-size: 20px; | |
| # font-weight: bold; | |
| # border-radius: 10px; | |
| # width: 90%; /* 让标题与其他部分宽度一致 */ | |
| # margin: 0 auto; /* 标题居中 */ | |
| # } | |
| # #container { | |
| # display: flex; | |
| # justify-content: space-between; /* 内容之间的间距 */ | |
| # width: 90%; /* 使整个容器占据父容器的90% */ | |
| # margin: 0 auto; /* 让容器水平居中 */ | |
| # gap: 5px; /* 在 input_section 和 output_section 之间增加间距 */ | |
| # } | |
| # #input_section { | |
| # width: 48%; /* 减少留白,输入板块占父容器的48% */ | |
| # padding: 10px; | |
| # background: #f8f8f8; | |
| # border-radius: 10px; | |
| # overflow-y: auto; /* 如果内容超过高度,会显示滚动条 */ | |
| # } | |
| # # input_title { | |
| # font-size: 18px; | |
| # } | |
| # #output_section { | |
| # width: 48%; /* 减少留白,输出板块占父容器的48% */ | |
| # padding: 10px; | |
| # background: #f8f8f8; | |
| # border-radius: 10px; | |
| # overflow-y: auto; /* 如果内容超过高度,会显示滚动条 */ | |
| # font-size: 18px; | |
| # } | |
| # # output_title { | |
| # font-size: 18px; | |
| # } | |
| # #start-warning-button { | |
| # margin-top: 20px; | |
| # text-align: center; | |
| # width: 90%; /* 按钮宽度与标题和板块一致 */ | |
| # background-color: darkred; | |
| # color: white; | |
| # font-weight: bold; | |
| # padding: 5px; /* 为按钮添加内边距,避免太紧凑 */ | |
| # border-radius: 10px; /* 增加圆角,使按钮看起来更美观 */ | |
| # margin-left: auto; /* 居中按钮 */ | |
| # margin-right: auto; /* 居中按钮 */ | |
| # } | |
| # """ |