oafuncs 0.0.98.48__py3-none-any.whl → 0.0.98.50__py3-none-any.whl

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/_script/email.py CHANGED
@@ -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="16031215@qq.com"):
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__":
oafuncs/oa_tool.py CHANGED
@@ -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 = "10001@qq.com") -> None:
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(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: oafuncs
3
- Version: 0.0.98.48
3
+ Version: 0.0.98.50
4
4
  Summary: Oceanic and Atmospheric Functions
5
5
  Home-page: https://github.com/Industry-Pays/OAFuncs
6
6
  Author: Kun Liu
@@ -9,12 +9,12 @@ oafuncs/oa_help.py,sha256=0J5VaZX-cB0c090KxgmktQJBc0o00FsY-4wB8l5y00k,4178
9
9
  oafuncs/oa_linux.py,sha256=-Bz0frciYl2Eb8YV4QKV7Yc65ice8TuRiRXTneLqnTk,5632
10
10
  oafuncs/oa_nc.py,sha256=j501NlTuvrDIwNLXbMfE7nPPXdbbL7u9PGDj2l5AtnI,16277
11
11
  oafuncs/oa_python.py,sha256=xYMQnM0cGq9xUCtcoMpnN0LG5Rc_s94tai5nC6CNJ3E,4831
12
- oafuncs/oa_tool.py,sha256=VHx15VqpbzNlVXh0-3nJqcDgLVaECMD1FvxJ_CrV39E,8046
12
+ oafuncs/oa_tool.py,sha256=0US1oheFCajBhhXL36XoNiJwimCXGDLKvlWyG1NAwO8,8119
13
13
  oafuncs/_data/hycom.png,sha256=MadKs6Gyj5n9-TOu7L4atQfTXtF9dvN9w-tdU9IfygI,10945710
14
14
  oafuncs/_data/oafuncs.png,sha256=o3VD7wm-kwDea5E98JqxXl04_78cBX7VcdUt7uQXGiU,3679898
15
15
  oafuncs/_script/cprogressbar.py,sha256=BZi3MzF4q2Yl6fdZcLnW8MdpgpLeldI5NvnWMr-ZS94,16023
16
16
  oafuncs/_script/data_interp.py,sha256=gr1coA2N1mxzS4iv6S0C4lZpEQbuuHHNW-08RrhgPAA,4774
17
- oafuncs/_script/email.py,sha256=57jhRflm5QsyIshGMqtlfC6qn3b86GyiL4RQxdCOgxU,2702
17
+ oafuncs/_script/email.py,sha256=BI-6tdnwt11DWCpIBuu4xeF33z9BCTlnuJvzNOYUUMI,2165
18
18
  oafuncs/_script/netcdf_merge.py,sha256=tM9ePqLiEsE7eIsNM5XjEYeXwxjYOdNz5ejnEuI7xKw,6066
19
19
  oafuncs/_script/netcdf_modify.py,sha256=XDlAEToe_lwfAetkBSENqU5df-wnH7MGuxNTjG1gwHY,4178
20
20
  oafuncs/_script/netcdf_write.py,sha256=EDNycnhlrW1c6zcpmpObQeszDRX_lRxjTL-j0G4HqjI,17420
@@ -39,8 +39,8 @@ oafuncs/oa_sign/__init__.py,sha256=JSx1fcWpmNhQBvX_Bmq3xysfSkkFMrjbJASxV_V6aqE,1
39
39
  oafuncs/oa_sign/meteorological.py,sha256=3MSjy7HTcvz2zsITkjUMr_0Y027Gas1LFE9pk99990k,6110
40
40
  oafuncs/oa_sign/ocean.py,sha256=3uYEzaq-27yVy23IQoqy-clhWu1I_fhPFBAQyT-OF4M,5562
41
41
  oafuncs/oa_sign/scientific.py,sha256=moIl2MEY4uitbXoD596JmXookXGQtQsS-8_1NBBTx84,4689
42
- oafuncs-0.0.98.48.dist-info/licenses/LICENSE.txt,sha256=rMtLpVg8sKiSlwClfR9w_Dd_5WubTQgoOzE2PDFxzs4,1074
43
- oafuncs-0.0.98.48.dist-info/METADATA,sha256=SMLqsAiP_mIAI-Z8i0UadDvIrDamuY91DFM2ddyzPwA,4446
44
- oafuncs-0.0.98.48.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
45
- oafuncs-0.0.98.48.dist-info/top_level.txt,sha256=bgC35QkXbN4EmPHEveg_xGIZ5i9NNPYWqtJqaKqTPsQ,8
46
- oafuncs-0.0.98.48.dist-info/RECORD,,
42
+ oafuncs-0.0.98.50.dist-info/licenses/LICENSE.txt,sha256=rMtLpVg8sKiSlwClfR9w_Dd_5WubTQgoOzE2PDFxzs4,1074
43
+ oafuncs-0.0.98.50.dist-info/METADATA,sha256=nyGa0OXF42YKMCR7ktMDONVP7AVMAtT3z9QdY366SvE,4446
44
+ oafuncs-0.0.98.50.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
45
+ oafuncs-0.0.98.50.dist-info/top_level.txt,sha256=bgC35QkXbN4EmPHEveg_xGIZ5i9NNPYWqtJqaKqTPsQ,8
46
+ oafuncs-0.0.98.50.dist-info/RECORD,,