refactor: 重构运行提示传递逻辑

This commit is contained in:
Quan
2025-12-16 12:55:52 +08:00
parent 8039c6a5db
commit 855113c94d
11 changed files with 117 additions and 181 deletions

View File

@@ -1,5 +1,6 @@
from asyncio import sleep
from random import uniform
from typing import Callable
from rich import print
from rich.text import Text
@@ -37,15 +38,16 @@ def retry_limited(function):
return inner
def logging(log, text, style=INFO):
def logging(log: Callable, text, style=INFO):
string = Text(text, style=style)
if log:
log.write(
func = log()
if func is print:
func(string)
else:
func.write(
string,
scroll_end=True,
)
else:
print(string)
async def sleep_time(