reykit 1.2.0__py3-none-any.whl → 1.2.1__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.
reykit/rnet.py CHANGED
@@ -67,13 +67,13 @@ RequestCacheParameters = TypedDict(
67
67
  )
68
68
 
69
69
 
70
- def join_url(*urls: str, **params: dict) -> str:
70
+ def join_url(*urls: Any, **params: dict) -> str:
71
71
  """
72
72
  Join URL and parameters.
73
73
 
74
74
  Parameters
75
75
  ----------
76
- urls : URL.
76
+ urls : URL parts.
77
77
  params : URL parameters.
78
78
 
79
79
  Returns
@@ -81,9 +81,12 @@ def join_url(*urls: str, **params: dict) -> str:
81
81
  Joined URL.
82
82
  """
83
83
 
84
- # Check.
84
+ # Parameter.
85
85
  if len(urls) == 0:
86
86
  throw(ValueError, urls)
87
+ for index, url in enumerate(urls):
88
+ if type(url) != str:
89
+ urls[index] = str(url)
87
90
 
88
91
  # Join URL.
89
92
  url: str = '/'.join(urls)
@@ -421,9 +424,6 @@ def get_response_file_name(response: Response, default_name: str | None = None)
421
424
  File name.
422
425
  """
423
426
 
424
- # Parameter.
425
- content = response.content
426
-
427
427
  # Get.
428
428
  file_name = None
429
429
  Content_disposition = response.headers.get('Content-Disposition', '')
@@ -442,6 +442,7 @@ def get_response_file_name(response: Response, default_name: str | None = None)
442
442
  file_name = url_parts[-1]
443
443
  if file_name is None:
444
444
  if default_name is None:
445
+ content = response.content
445
446
  default_name = get_md5(content)
446
447
  file_type_obj = filetype_guess(content)
447
448
  if file_type_obj is not None:
reykit/rtask.py CHANGED
@@ -560,6 +560,36 @@ async def async_request(
560
560
  check: bool | int | Iterable[int] = False
561
561
  ) -> bytes: ...
562
562
 
563
+ @overload
564
+ async def async_request(
565
+ url: str,
566
+ params: dict | None = None,
567
+ data: dict | str | bytes | None = None,
568
+ *,
569
+ headers: dict[str, str] = {},
570
+ timeout: float | None = None,
571
+ proxy: str | None = None,
572
+ ssl: bool = False,
573
+ method: Literal['get', 'post', 'put', 'patch', 'delete', 'options', 'head'] | None = None,
574
+ check: bool | int | Iterable[int] = False,
575
+ handler: str
576
+ ) -> Any: ...
577
+
578
+ @overload
579
+ async def async_request(
580
+ url: str,
581
+ params: dict | None = None,
582
+ *,
583
+ json: dict | None = None,
584
+ headers: dict[str, str] = {},
585
+ timeout: float | None = None,
586
+ proxy: str | None = None,
587
+ ssl: bool = False,
588
+ method: Literal['get', 'post', 'put', 'patch', 'delete', 'options', 'head'] | None = None,
589
+ check: bool | int | Iterable[int] = False,
590
+ handler: str
591
+ ) -> Any: ...
592
+
563
593
  @overload
564
594
  async def async_request(
565
595
  url: str,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: reykit
3
- Version: 1.2.0
3
+ Version: 1.2.1
4
4
  Summary: Kit method set.
5
5
  Project-URL: homepage, https://github.com/reyxbo/reykit/
6
6
  Author-email: Rey <reyxbo@163.com>
@@ -6,7 +6,7 @@ reykit/remail.py,sha256=DE4sxfJEXNu6MiBJKUsWXqvBrIOJNmnm_1lnGL0tZec,6693
6
6
  reykit/rimage.py,sha256=z-cjI_MgEbUhuKgIbvDS_e2fy2CrnBhr_FS6D8XuAg0,6124
7
7
  reykit/rlog.py,sha256=yBArs48wl509v4q7e1vHbE3E_Bqi3VHEV-Iuw2Y58f8,25649
8
8
  reykit/rmonkey.py,sha256=PBA19EqlJHI9FxT8C4-t59RlyAfwfhX7xV9ZJ3PegWo,7894
9
- reykit/rnet.py,sha256=XaPV8jTrO8u9Uv7JKeSwr-Fpc8vXXCZ2EXRNfiDuJuE,17849
9
+ reykit/rnet.py,sha256=UlzkOttGxZPld8WCzbjbx-NUziPEj-n82mHH48zKBsA,17953
10
10
  reykit/rnum.py,sha256=WNtvKSS-MkgmudIqDR8Xv4WIdNLyEPIO0jz5ukL3cXg,3603
11
11
  reykit/ros.py,sha256=quDCZfqpYtZRgyK2wtscm92oPm3PaKoBqDBAaM29HV8,47714
12
12
  reykit/rrand.py,sha256=nH0e4wRiLba7Tg6pRyn7qnPrzIXdlJxm7e4S1EqsBLQ,8549
@@ -15,14 +15,14 @@ reykit/rschedule.py,sha256=H7JQbX3kVFetmGS2EZ_216NnZj-ilGl6h1MusIx8ZWk,12288
15
15
  reykit/rstdout.py,sha256=YEKP8-OcCSk8TTtChgqTkO7NSnJ5LOb77d2qiE_3vLI,8081
16
16
  reykit/rsys.py,sha256=zxHeahRwCNonyprHfw6yFT9qMkITBwInOlWuvaXgnhQ,24894
17
17
  reykit/rtable.py,sha256=fTeuiZNGelSfAT-BIjT2u-wgkh9WpphgdD7gj_TcFw0,10587
18
- reykit/rtask.py,sha256=Yx44brRNh3AlshchJ8UEBgjmJxCJtBLjBW93E4fJrng,28372
18
+ reykit/rtask.py,sha256=yKhsAhoMfJ99LQbKB-xc8bmP7mehC60aroK49X5N-_4,29242
19
19
  reykit/rtext.py,sha256=cf3a0uGmdr2ucKjGzYkQFkUPdixKJW1c82FPDdmRzwM,13227
20
20
  reykit/rtime.py,sha256=3UPpUK027TY1Wgf5bzwCQo1N4ZceZ2YtcZzM9I8Q9Qg,17766
21
21
  reykit/rwrap.py,sha256=lOKBhSqx8V_PcsdipPP4SaiGXXcpfaEhO_qEGSySEkw,15065
22
22
  reykit/rzip.py,sha256=vYw17toqg-DbMjvycluohU9zVX73uYYqQGAp_b21pA8,3433
23
23
  reykit/rdll/__init__.py,sha256=mewj06HHIzzW6oreQAz-6in2zYwNJ4-d1eWWL7CPQgc,685
24
24
  reykit/rdll/rdll_core.py,sha256=zBmOyxD6LkbNIadXmFHLJinj-6UFko8D6w5d7hYA7vU,5077
25
- reykit-1.2.0.dist-info/METADATA,sha256=a7tM1JYPOslzUizVLL3rrEHwaEwjSZm5bZhouwZVRe0,1880
26
- reykit-1.2.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
27
- reykit-1.2.0.dist-info/licenses/LICENSE,sha256=UYLPqp7BvPiH8yEZduJqmmyEl6hlM3lKrFIefiD4rvk,1059
28
- reykit-1.2.0.dist-info/RECORD,,
25
+ reykit-1.2.1.dist-info/METADATA,sha256=B4vGbMbYqdLF4jOsZuO8Y3PUzijGQAT0aPmqpeSw17A,1880
26
+ reykit-1.2.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
27
+ reykit-1.2.1.dist-info/licenses/LICENSE,sha256=UYLPqp7BvPiH8yEZduJqmmyEl6hlM3lKrFIefiD4rvk,1059
28
+ reykit-1.2.1.dist-info/RECORD,,
File without changes