oafuncs 0.0.98.49__tar.gz → 0.0.98.50__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {oafuncs-0.0.98.49/oafuncs.egg-info → oafuncs-0.0.98.50}/PKG-INFO +1 -1
- {oafuncs-0.0.98.49 → oafuncs-0.0.98.50}/oafuncs/_script/email.py +7 -24
- {oafuncs-0.0.98.49 → oafuncs-0.0.98.50}/oafuncs/oa_tool.py +2 -2
- {oafuncs-0.0.98.49 → oafuncs-0.0.98.50/oafuncs.egg-info}/PKG-INFO +1 -1
- {oafuncs-0.0.98.49 → oafuncs-0.0.98.50}/setup.py +1 -1
- {oafuncs-0.0.98.49 → oafuncs-0.0.98.50}/LICENSE.txt +0 -0
- {oafuncs-0.0.98.49 → oafuncs-0.0.98.50}/MANIFEST.in +0 -0
- {oafuncs-0.0.98.49 → oafuncs-0.0.98.50}/README.md +0 -0
- {oafuncs-0.0.98.49 → oafuncs-0.0.98.50}/oafuncs/__init__.py +0 -0
- {oafuncs-0.0.98.49 → oafuncs-0.0.98.50}/oafuncs/_data/hycom.png +0 -0
- {oafuncs-0.0.98.49 → oafuncs-0.0.98.50}/oafuncs/_data/oafuncs.png +0 -0
- {oafuncs-0.0.98.49 → oafuncs-0.0.98.50}/oafuncs/_script/cprogressbar.py +0 -0
- {oafuncs-0.0.98.49 → oafuncs-0.0.98.50}/oafuncs/_script/data_interp.py +0 -0
- {oafuncs-0.0.98.49 → oafuncs-0.0.98.50}/oafuncs/_script/netcdf_merge.py +0 -0
- {oafuncs-0.0.98.49 → oafuncs-0.0.98.50}/oafuncs/_script/netcdf_modify.py +0 -0
- {oafuncs-0.0.98.49 → oafuncs-0.0.98.50}/oafuncs/_script/netcdf_write.py +0 -0
- {oafuncs-0.0.98.49 → oafuncs-0.0.98.50}/oafuncs/_script/parallel.py +0 -0
- {oafuncs-0.0.98.49 → oafuncs-0.0.98.50}/oafuncs/_script/parallel_bak.py +0 -0
- {oafuncs-0.0.98.49 → oafuncs-0.0.98.50}/oafuncs/_script/plot_dataset.py +0 -0
- {oafuncs-0.0.98.49 → oafuncs-0.0.98.50}/oafuncs/_script/replace_file_content.py +0 -0
- {oafuncs-0.0.98.49 → oafuncs-0.0.98.50}/oafuncs/oa_cmap.py +0 -0
- {oafuncs-0.0.98.49 → oafuncs-0.0.98.50}/oafuncs/oa_data.py +0 -0
- {oafuncs-0.0.98.49 → oafuncs-0.0.98.50}/oafuncs/oa_date.py +0 -0
- {oafuncs-0.0.98.49 → oafuncs-0.0.98.50}/oafuncs/oa_down/User_Agent-list.txt +0 -0
- {oafuncs-0.0.98.49 → oafuncs-0.0.98.50}/oafuncs/oa_down/__init__.py +0 -0
- {oafuncs-0.0.98.49 → oafuncs-0.0.98.50}/oafuncs/oa_down/hycom_3hourly.py +0 -0
- {oafuncs-0.0.98.49 → oafuncs-0.0.98.50}/oafuncs/oa_down/idm.py +0 -0
- {oafuncs-0.0.98.49 → oafuncs-0.0.98.50}/oafuncs/oa_down/literature.py +0 -0
- {oafuncs-0.0.98.49 → oafuncs-0.0.98.50}/oafuncs/oa_down/read_proxy.py +0 -0
- {oafuncs-0.0.98.49 → oafuncs-0.0.98.50}/oafuncs/oa_down/test_ua.py +0 -0
- {oafuncs-0.0.98.49 → oafuncs-0.0.98.50}/oafuncs/oa_down/user_agent.py +0 -0
- {oafuncs-0.0.98.49 → oafuncs-0.0.98.50}/oafuncs/oa_draw.py +0 -0
- {oafuncs-0.0.98.49 → oafuncs-0.0.98.50}/oafuncs/oa_file.py +0 -0
- {oafuncs-0.0.98.49 → oafuncs-0.0.98.50}/oafuncs/oa_geo.py +0 -0
- {oafuncs-0.0.98.49 → oafuncs-0.0.98.50}/oafuncs/oa_help.py +0 -0
- {oafuncs-0.0.98.49 → oafuncs-0.0.98.50}/oafuncs/oa_linux.py +0 -0
- {oafuncs-0.0.98.49 → oafuncs-0.0.98.50}/oafuncs/oa_model/__init__.py +0 -0
- {oafuncs-0.0.98.49 → oafuncs-0.0.98.50}/oafuncs/oa_model/roms/__init__.py +0 -0
- {oafuncs-0.0.98.49 → oafuncs-0.0.98.50}/oafuncs/oa_model/roms/test.py +0 -0
- {oafuncs-0.0.98.49 → oafuncs-0.0.98.50}/oafuncs/oa_model/wrf/__init__.py +0 -0
- {oafuncs-0.0.98.49 → oafuncs-0.0.98.50}/oafuncs/oa_model/wrf/little_r.py +0 -0
- {oafuncs-0.0.98.49 → oafuncs-0.0.98.50}/oafuncs/oa_nc.py +0 -0
- {oafuncs-0.0.98.49 → oafuncs-0.0.98.50}/oafuncs/oa_python.py +0 -0
- {oafuncs-0.0.98.49 → oafuncs-0.0.98.50}/oafuncs/oa_sign/__init__.py +0 -0
- {oafuncs-0.0.98.49 → oafuncs-0.0.98.50}/oafuncs/oa_sign/meteorological.py +0 -0
- {oafuncs-0.0.98.49 → oafuncs-0.0.98.50}/oafuncs/oa_sign/ocean.py +0 -0
- {oafuncs-0.0.98.49 → oafuncs-0.0.98.50}/oafuncs/oa_sign/scientific.py +0 -0
- {oafuncs-0.0.98.49 → oafuncs-0.0.98.50}/oafuncs.egg-info/SOURCES.txt +0 -0
- {oafuncs-0.0.98.49 → oafuncs-0.0.98.50}/oafuncs.egg-info/dependency_links.txt +0 -0
- {oafuncs-0.0.98.49 → oafuncs-0.0.98.50}/oafuncs.egg-info/requires.txt +0 -0
- {oafuncs-0.0.98.49 → oafuncs-0.0.98.50}/oafuncs.egg-info/top_level.txt +0 -0
- {oafuncs-0.0.98.49 → oafuncs-0.0.98.50}/setup.cfg +0 -0
|
@@ -2,25 +2,8 @@ from rich import print
|
|
|
2
2
|
|
|
3
3
|
__all__ = ["send"]
|
|
4
4
|
|
|
5
|
-
def _email_info():
|
|
6
|
-
import random
|
|
7
|
-
email_dict = {
|
|
8
|
-
"liukun0312@vip.qq.com": [4, 13, -10, 2, -10, 4, -7, -8, 8, -1, 3, -2, -11, -6, -9, -7],
|
|
9
|
-
"756866877@qq.com": [4, -2, -3, 13, 12, 8, -6, 9, -12, 13, -10, -12, -11, -12, -4, -11],
|
|
10
|
-
"99138763@qq.com": [0, 6, 12, 2, 9, 9, 4, -1, 11, -7, -12, 6, -11, -3, -5, -11],
|
|
11
|
-
"1031260@qq.com": [-1, -5, -9, 9, -3, 4, -8, -7, -12, -2, 0, -9, -11, -3, -7, -10],
|
|
12
|
-
}
|
|
13
|
-
keys = list(email_dict.keys())
|
|
14
|
-
choose_email = random.randint(0, len(keys) - 1)
|
|
15
|
-
msg_from = keys[choose_email]
|
|
16
|
-
return msg_from, email_dict[msg_from]
|
|
17
5
|
|
|
18
|
-
|
|
19
|
-
def _decode_password(password):
|
|
20
|
-
return "".join([chr(i + 109) for i in password])
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
def _send_message(title, content, msg_to):
|
|
6
|
+
def _send_message(title, content, msg_to, msg_from, password):
|
|
24
7
|
from email.header import Header
|
|
25
8
|
from email.mime.multipart import MIMEMultipart
|
|
26
9
|
from email.mime.text import MIMEText
|
|
@@ -29,8 +12,9 @@ def _send_message(title, content, msg_to):
|
|
|
29
12
|
con = smtplib.SMTP_SSL("smtp.qq.com", 465)
|
|
30
13
|
|
|
31
14
|
# 2. 登录邮箱
|
|
32
|
-
msg_from, password = _email_info()
|
|
33
|
-
con.login(msg_from, _decode_password(password))
|
|
15
|
+
# msg_from, password = _email_info()
|
|
16
|
+
# con.login(msg_from, _decode_password(password))
|
|
17
|
+
con.login(msg_from, password)
|
|
34
18
|
|
|
35
19
|
# 3. 准备数据
|
|
36
20
|
# 创建邮件对象
|
|
@@ -70,7 +54,7 @@ def _send_message(title, content, msg_to):
|
|
|
70
54
|
print("发送内容为:\n{}\n\n".format(content))
|
|
71
55
|
|
|
72
56
|
|
|
73
|
-
def send(title="Title", content=None, send_to="
|
|
57
|
+
def send(title="Title", content=None, send_to: str = "email@qq.com", msg_from='must@qq.com', password='email_not_qq_pwd'):
|
|
74
58
|
"""
|
|
75
59
|
Description: 发送邮件
|
|
76
60
|
|
|
@@ -85,11 +69,10 @@ def send(title="Title", content=None, send_to="16031215@qq.com"):
|
|
|
85
69
|
Example:
|
|
86
70
|
send(title='Title', content='Content', '123@qq.com')
|
|
87
71
|
"""
|
|
88
|
-
if content is None:
|
|
89
|
-
# 避免发送空邮件,或有人误调用
|
|
72
|
+
if content is None or send_to=='email@qq.com' or msg_from=='must@qq.com' or password=='email_not_qq_pwd':
|
|
90
73
|
return
|
|
91
74
|
else:
|
|
92
|
-
_send_message(title, content, send_to)
|
|
75
|
+
_send_message(title, content, send_to, msg_from, password)
|
|
93
76
|
|
|
94
77
|
|
|
95
78
|
if __name__ == "__main__":
|
|
@@ -118,7 +118,7 @@ class PEx(ParallelExecutor):
|
|
|
118
118
|
|
|
119
119
|
|
|
120
120
|
|
|
121
|
-
def email(title: str = "Title", content: Optional[str] = None, send_to: str = "
|
|
121
|
+
def email(title: str = "Title", content: Optional[str] = None, send_to: str = "email@qq.com", msg_from='must@qq.com', password='email_not_qq_pwd') -> None:
|
|
122
122
|
"""
|
|
123
123
|
Send an email using the specified title, content, and recipient.
|
|
124
124
|
|
|
@@ -130,7 +130,7 @@ def email(title: str = "Title", content: Optional[str] = None, send_to: str = "1
|
|
|
130
130
|
from ._script.email import send
|
|
131
131
|
|
|
132
132
|
print(f"[green]Sending email to {send_to} with title: {title}[/green]")
|
|
133
|
-
send(title, content, send_to)
|
|
133
|
+
send(title, content, send_to, msg_from, password)
|
|
134
134
|
|
|
135
135
|
|
|
136
136
|
def pbar(
|
|
@@ -18,7 +18,7 @@ URL = "https://github.com/Industry-Pays/OAFuncs"
|
|
|
18
18
|
EMAIL = "liukun0312@stu.ouc.edu.cn"
|
|
19
19
|
AUTHOR = "Kun Liu"
|
|
20
20
|
REQUIRES_PYTHON = ">=3.10.0" # 2025/03/13
|
|
21
|
-
VERSION = "0.0.98.
|
|
21
|
+
VERSION = "0.0.98.50"
|
|
22
22
|
|
|
23
23
|
# What packages are required for this module to be executed?
|
|
24
24
|
REQUIRED = [
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|