oafuncs 0.0.98.49__py3-none-any.whl → 0.0.98.51__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
@@ -1,26 +1,8 @@
1
1
  from rich import print
2
2
 
3
- __all__ = ["send"]
4
3
 
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
4
 
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):
5
+ def _send_message(msg_from, password, msg_to, title, content):
24
6
  from email.header import Header
25
7
  from email.mime.multipart import MIMEMultipart
26
8
  from email.mime.text import MIMEText
@@ -29,8 +11,9 @@ def _send_message(title, content, msg_to):
29
11
  con = smtplib.SMTP_SSL("smtp.qq.com", 465)
30
12
 
31
13
  # 2. 登录邮箱
32
- msg_from, password = _email_info()
33
- con.login(msg_from, _decode_password(password))
14
+ # msg_from, password = _email_info()
15
+ # con.login(msg_from, _decode_password(password))
16
+ con.login(msg_from, password)
34
17
 
35
18
  # 3. 准备数据
36
19
  # 创建邮件对象
@@ -46,18 +29,6 @@ def _send_message(title, content, msg_to):
46
29
  # 设置邮件接受者
47
30
  msg["To"] = msg_to
48
31
 
49
- # # 添加html内容
50
- # content = """
51
- # <h2>我是正文中的标题</h2>
52
- # <p>邮件正文描述性文字1</p>
53
- # <p>邮件正文描述性文字2</p>
54
- # <img src='https://www.baidu.com/img/bd_logo1.png'>
55
- # <center>百度图片</center>
56
- # <a href='https://www.baidu.com'>百度一下</a>
57
- # """
58
- # html = MIMEText(content, 'html', 'utf-8')
59
- # msg.attach(html)
60
-
61
32
  # or
62
33
  # content = '发送内容'
63
34
  msg.attach(MIMEText(content, "plain", "utf-8"))
@@ -70,27 +41,8 @@ def _send_message(title, content, msg_to):
70
41
  print("发送内容为:\n{}\n\n".format(content))
71
42
 
72
43
 
73
- def send(title="Title", content=None, send_to="16031215@qq.com"):
74
- """
75
- Description: 发送邮件
76
-
77
- Args:
78
- title: 邮件标题
79
- content: 邮件内容
80
- send_to: 发送对象
81
-
82
- Returns:
83
- None
84
44
 
85
- Example:
86
- send(title='Title', content='Content', '123@qq.com')
87
- """
88
- if content is None:
89
- # 避免发送空邮件,或有人误调用
90
- return
91
- else:
92
- _send_message(title, content, send_to)
93
45
 
94
46
 
95
47
  if __name__ == "__main__":
96
- send()
48
+ pass
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(email_from, email_pwd, email_to, title = None, content = None) -> None:
122
122
  """
123
123
  Send an email using the specified title, content, and recipient.
124
124
 
@@ -127,10 +127,10 @@ def email(title: str = "Title", content: Optional[str] = None, send_to: str = "1
127
127
  content (Optional[str]): The content of the email. Defaults to None.
128
128
  send_to (str): The recipient's email address. Defaults to "10001@qq.com".
129
129
  """
130
- from ._script.email import send
130
+ from ._script.email import _send_message
131
131
 
132
- print(f"[green]Sending email to {send_to} with title: {title}[/green]")
133
- send(title, content, send_to)
132
+ print(f"[green]Sending email to {email_to} with title: {title}[/green]")
133
+ _send_message(email_from, email_pwd, email_to, title, content)
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.49
3
+ Version: 0.0.98.51
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=EPlaLT6qXXN5f9owYIiN6jHa7_DwE3dlKLv4ucDL6jg,8068
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=qXwn6CTzYOuhiYUf28xLA9kHJ8cvnv89plY_9xbP9jo,1143
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.49.dist-info/licenses/LICENSE.txt,sha256=rMtLpVg8sKiSlwClfR9w_Dd_5WubTQgoOzE2PDFxzs4,1074
43
- oafuncs-0.0.98.49.dist-info/METADATA,sha256=NChWCVgHRvvUwckqJL5cZ55ZPwOud6PPWA2hX_0i1io,4446
44
- oafuncs-0.0.98.49.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
45
- oafuncs-0.0.98.49.dist-info/top_level.txt,sha256=bgC35QkXbN4EmPHEveg_xGIZ5i9NNPYWqtJqaKqTPsQ,8
46
- oafuncs-0.0.98.49.dist-info/RECORD,,
42
+ oafuncs-0.0.98.51.dist-info/licenses/LICENSE.txt,sha256=rMtLpVg8sKiSlwClfR9w_Dd_5WubTQgoOzE2PDFxzs4,1074
43
+ oafuncs-0.0.98.51.dist-info/METADATA,sha256=lcmNhRPELwHW8PheYNMHl4A_Y3lD95Fd2yCcyaa3x0c,4446
44
+ oafuncs-0.0.98.51.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
45
+ oafuncs-0.0.98.51.dist-info/top_level.txt,sha256=bgC35QkXbN4EmPHEveg_xGIZ5i9NNPYWqtJqaKqTPsQ,8
46
+ oafuncs-0.0.98.51.dist-info/RECORD,,