ezKit 3.0.4__tar.gz → 3.0.5__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ezKit
3
- Version: 3.0.4
3
+ Version: 3.0.5
4
4
  Summary: Easy Kit
5
5
  Author: septvean
6
6
  Author-email: septvean@gmail.com
@@ -14,11 +14,12 @@ from . import utils
14
14
  DEBUG = environ.get("DEBUG")
15
15
 
16
16
 
17
- class TypedSMTP(TypedDict):
17
+ class TypedSMTP(TypedDict, total=False):
18
18
  """smtp type"""
19
19
 
20
20
  server: str
21
21
  port: int
22
+ timeout: Optional[float]
22
23
  # tls: bool
23
24
 
24
25
 
@@ -120,6 +121,7 @@ async def sendemail(
120
121
 
121
122
  smtp_host = smtp.get("server")
122
123
  smtp_port = smtp.get("port")
124
+ smtp_timeout = smtp.get("timeout", 10.0)
123
125
  # smtp_tls = smtp.get("tls", False)
124
126
 
125
127
  if not smtp_host or not smtp_port:
@@ -178,7 +180,7 @@ async def sendemail(
178
180
  # ------------------------------------------------------------------------------------------
179
181
 
180
182
  # 使用 aiomail 发送邮件
181
- async with aiosmtplib.SMTP(hostname=smtp_host, port=smtp_port) as smtp_server:
183
+ async with aiosmtplib.SMTP(hostname=smtp_host, port=smtp_port, timeout=smtp_timeout) as smtp_server:
182
184
 
183
185
  # if smtp_tls:
184
186
  # await smtp_server.starttls()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ezKit
3
- Version: 3.0.4
3
+ Version: 3.0.5
4
4
  Summary: Easy Kit
5
5
  Author: septvean
6
6
  Author-email: septvean@gmail.com
@@ -4,7 +4,7 @@ from setuptools import find_packages, setup
4
4
 
5
5
  setup(
6
6
  name="ezKit",
7
- version="3.0.4",
7
+ version="3.0.5",
8
8
  author="septvean",
9
9
  author_email="septvean@gmail.com",
10
10
  description="Easy Kit",
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