pycoze 0.1.326__py3-none-any.whl → 0.1.327__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.
- pycoze/reference/lib.py +6 -9
- {pycoze-0.1.326.dist-info → pycoze-0.1.327.dist-info}/METADATA +1 -1
- {pycoze-0.1.326.dist-info → pycoze-0.1.327.dist-info}/RECORD +6 -6
- {pycoze-0.1.326.dist-info → pycoze-0.1.327.dist-info}/LICENSE +0 -0
- {pycoze-0.1.326.dist-info → pycoze-0.1.327.dist-info}/WHEEL +0 -0
- {pycoze-0.1.326.dist-info → pycoze-0.1.327.dist-info}/top_level.txt +0 -0
pycoze/reference/lib.py
CHANGED
@@ -5,12 +5,6 @@ import functools
|
|
5
5
|
import inspect
|
6
6
|
import asyncio
|
7
7
|
|
8
|
-
import inspect
|
9
|
-
import asyncio
|
10
|
-
|
11
|
-
import inspect
|
12
|
-
import asyncio
|
13
|
-
|
14
8
|
def call_func(func, args=None, kwargs=None):
|
15
9
|
if args is None:
|
16
10
|
args = ()
|
@@ -30,11 +24,14 @@ def call_func(func, args=None, kwargs=None):
|
|
30
24
|
# 如果没有运行的事件循环,使用 asyncio.run()
|
31
25
|
return asyncio.run(coro)
|
32
26
|
else:
|
33
|
-
#
|
27
|
+
# 如果事件循环已经在运行,直接调度协程并等待结果
|
34
28
|
async def run_coro():
|
35
29
|
return await coro
|
36
|
-
#
|
37
|
-
|
30
|
+
# 在当前事件循环中调度任务并等待完成
|
31
|
+
future = asyncio.ensure_future(run_coro())
|
32
|
+
while not future.done():
|
33
|
+
loop.run_until_complete(asyncio.sleep(0.1)) # 避免阻塞
|
34
|
+
return future.result()
|
38
35
|
else:
|
39
36
|
return func(*args, **kwargs)
|
40
37
|
|
@@ -20,7 +20,7 @@ pycoze/bot/prompt.md,sha256=ehjdvZ-se9NaH0OSiDEvrFE9kvdj9MTZlWZUTxPY780,15743
|
|
20
20
|
pycoze/bot/tools.py,sha256=HqfBaJjS9Jg9-MGObD5Iegs8NZsM63DIPbaoMRZR5ms,9737
|
21
21
|
pycoze/reference/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
22
22
|
pycoze/reference/bot.py,sha256=pxHVYo0G3P3YZ--vBYbMEiEyBoxxPwaO5dMTf9WFMSc,2014
|
23
|
-
pycoze/reference/lib.py,sha256=
|
23
|
+
pycoze/reference/lib.py,sha256=yDb5hL41IUlhHyqXv06a26KrvNxBnoCvgyaflWdMmJ8,3450
|
24
24
|
pycoze/reference/tool.py,sha256=h7G3KSoZYWq5IJu6E0-shIQ3XiJeJsgSM85GxEnhF98,1107
|
25
25
|
pycoze/reference/workflow.py,sha256=whQtw_FAxvlSbjow1oNFLdytPjjRs_pDBbQmNjaX6zc,1340
|
26
26
|
pycoze/ui/__init__.py,sha256=uaXet23wUk64TcZjpBX8qOx4aUhwA_ucrmcxy7Q4Qr4,929
|
@@ -33,8 +33,8 @@ pycoze/utils/arg.py,sha256=jop1tBfe5hYkHW1NSpCeaZBEznkgguBscj_7M2dWfrs,503
|
|
33
33
|
pycoze/utils/env.py,sha256=5pWlXfM1F5ZU9hhv1rHlDEanjEW5wf0nbyez9bNRqqA,559
|
34
34
|
pycoze/utils/socket.py,sha256=bZbFFRH4mfThzRqt55BAAGQ6eICx_ja4x8UGGrUdAm8,2428
|
35
35
|
pycoze/utils/text_or_file.py,sha256=gpxZVWt2DW6YiEg_MnMuwg36VNf3TX383QD_1oZNB0Y,551
|
36
|
-
pycoze-0.1.
|
37
|
-
pycoze-0.1.
|
38
|
-
pycoze-0.1.
|
39
|
-
pycoze-0.1.
|
40
|
-
pycoze-0.1.
|
36
|
+
pycoze-0.1.327.dist-info/LICENSE,sha256=QStd_Qsd0-kAam_-sOesCIp_uKrGWeoKwt9M49NVkNU,1090
|
37
|
+
pycoze-0.1.327.dist-info/METADATA,sha256=Ez0RD1P_AICRYbbs_irfvT1-j6zF8fIYom1aqSi8ILs,854
|
38
|
+
pycoze-0.1.327.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
39
|
+
pycoze-0.1.327.dist-info/top_level.txt,sha256=76dPeDhKvOCleL3ZC5gl1-y4vdS1tT_U1hxWVAn7sFo,7
|
40
|
+
pycoze-0.1.327.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|