oafuncs 0.0.98.50__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 +2 -33
 - oafuncs/oa_tool.py +4 -4
 - {oafuncs-0.0.98.50.dist-info → oafuncs-0.0.98.51.dist-info}/METADATA +1 -1
 - {oafuncs-0.0.98.50.dist-info → oafuncs-0.0.98.51.dist-info}/RECORD +7 -7
 - {oafuncs-0.0.98.50.dist-info → oafuncs-0.0.98.51.dist-info}/WHEEL +0 -0
 - {oafuncs-0.0.98.50.dist-info → oafuncs-0.0.98.51.dist-info}/licenses/LICENSE.txt +0 -0
 - {oafuncs-0.0.98.50.dist-info → oafuncs-0.0.98.51.dist-info}/top_level.txt +0 -0
 
    
        oafuncs/_script/email.py
    CHANGED
    
    | 
         @@ -1,9 +1,8 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            from rich import print
         
     | 
| 
       2 
2 
     | 
    
         | 
| 
       3 
     | 
    
         
            -
            __all__ = ["send"]
         
     | 
| 
       4 
3 
     | 
    
         | 
| 
       5 
4 
     | 
    
         | 
| 
       6 
     | 
    
         
            -
            def _send_message( 
     | 
| 
      
 5 
     | 
    
         
            +
            def _send_message(msg_from, password, msg_to, title, content):
         
     | 
| 
       7 
6 
     | 
    
         
             
                from email.header import Header
         
     | 
| 
       8 
7 
     | 
    
         
             
                from email.mime.multipart import MIMEMultipart
         
     | 
| 
       9 
8 
     | 
    
         
             
                from email.mime.text import MIMEText
         
     | 
| 
         @@ -30,18 +29,6 @@ def _send_message(title, content, msg_to, msg_from, password): 
     | 
|
| 
       30 
29 
     | 
    
         
             
                # 设置邮件接受者
         
     | 
| 
       31 
30 
     | 
    
         
             
                msg["To"] = msg_to
         
     | 
| 
       32 
31 
     | 
    
         | 
| 
       33 
     | 
    
         
            -
                # # 添加html内容
         
     | 
| 
       34 
     | 
    
         
            -
                # content = """
         
     | 
| 
       35 
     | 
    
         
            -
                # <h2>我是正文中的标题</h2>
         
     | 
| 
       36 
     | 
    
         
            -
                # <p>邮件正文描述性文字1</p>
         
     | 
| 
       37 
     | 
    
         
            -
                # <p>邮件正文描述性文字2</p>
         
     | 
| 
       38 
     | 
    
         
            -
                # <img src='https://www.baidu.com/img/bd_logo1.png'>
         
     | 
| 
       39 
     | 
    
         
            -
                # <center>百度图片</center>
         
     | 
| 
       40 
     | 
    
         
            -
                # <a href='https://www.baidu.com'>百度一下</a>
         
     | 
| 
       41 
     | 
    
         
            -
                # """
         
     | 
| 
       42 
     | 
    
         
            -
                # html = MIMEText(content, 'html', 'utf-8')
         
     | 
| 
       43 
     | 
    
         
            -
                # msg.attach(html)
         
     | 
| 
       44 
     | 
    
         
            -
             
     | 
| 
       45 
32 
     | 
    
         
             
                # or
         
     | 
| 
       46 
33 
     | 
    
         
             
                # content = '发送内容'
         
     | 
| 
       47 
34 
     | 
    
         
             
                msg.attach(MIMEText(content, "plain", "utf-8"))
         
     | 
| 
         @@ -54,26 +41,8 @@ def _send_message(title, content, msg_to, msg_from, password): 
     | 
|
| 
       54 
41 
     | 
    
         
             
                print("发送内容为:\n{}\n\n".format(content))
         
     | 
| 
       55 
42 
     | 
    
         | 
| 
       56 
43 
     | 
    
         | 
| 
       57 
     | 
    
         
            -
            def send(title="Title", content=None, send_to: str = "email@qq.com", msg_from='must@qq.com', password='email_not_qq_pwd'):
         
     | 
| 
       58 
     | 
    
         
            -
                """
         
     | 
| 
       59 
     | 
    
         
            -
                Description: 发送邮件
         
     | 
| 
       60 
     | 
    
         
            -
             
     | 
| 
       61 
     | 
    
         
            -
                Args:
         
     | 
| 
       62 
     | 
    
         
            -
                    title: 邮件标题
         
     | 
| 
       63 
     | 
    
         
            -
                    content: 邮件内容
         
     | 
| 
       64 
     | 
    
         
            -
                    send_to: 发送对象
         
     | 
| 
       65 
     | 
    
         
            -
             
     | 
| 
       66 
     | 
    
         
            -
                Returns:
         
     | 
| 
       67 
     | 
    
         
            -
                    None
         
     | 
| 
       68 
44 
     | 
    
         | 
| 
       69 
     | 
    
         
            -
                Example:
         
     | 
| 
       70 
     | 
    
         
            -
                    send(title='Title', content='Content', '123@qq.com')
         
     | 
| 
       71 
     | 
    
         
            -
                """
         
     | 
| 
       72 
     | 
    
         
            -
                if content is None or send_to=='email@qq.com' or msg_from=='must@qq.com' or password=='email_not_qq_pwd':
         
     | 
| 
       73 
     | 
    
         
            -
                    return
         
     | 
| 
       74 
     | 
    
         
            -
                else:
         
     | 
| 
       75 
     | 
    
         
            -
                    _send_message(title, content, send_to, msg_from, password)
         
     | 
| 
       76 
45 
     | 
    
         | 
| 
       77 
46 
     | 
    
         | 
| 
       78 
47 
     | 
    
         
             
            if __name__ == "__main__":
         
     | 
| 
       79 
     | 
    
         
            -
                 
     | 
| 
      
 48 
     | 
    
         
            +
                pass
         
     | 
    
        oafuncs/oa_tool.py
    CHANGED
    
    | 
         @@ -118,7 +118,7 @@ class PEx(ParallelExecutor): 
     | 
|
| 
       118 
118 
     | 
    
         | 
| 
       119 
119 
     | 
    
         | 
| 
       120 
120 
     | 
    
         | 
| 
       121 
     | 
    
         
            -
            def email( 
     | 
| 
      
 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 = "e 
     | 
|
| 
       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  
     | 
| 
      
 130 
     | 
    
         
            +
                from ._script.email import _send_message
         
     | 
| 
       131 
131 
     | 
    
         | 
| 
       132 
     | 
    
         
            -
                print(f"[green]Sending email to { 
     | 
| 
       133 
     | 
    
         
            -
                 
     | 
| 
      
 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(
         
     | 
| 
         @@ -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= 
     | 
| 
      
 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= 
     | 
| 
      
 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. 
     | 
| 
       43 
     | 
    
         
            -
            oafuncs-0.0.98. 
     | 
| 
       44 
     | 
    
         
            -
            oafuncs-0.0.98. 
     | 
| 
       45 
     | 
    
         
            -
            oafuncs-0.0.98. 
     | 
| 
       46 
     | 
    
         
            -
            oafuncs-0.0.98. 
     | 
| 
      
 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,,
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     |