改写战斗中替换group的逻辑

This commit is contained in:
Elaina 2024-10-13 01:24:58 +08:00
commit 7f89eb0db8
3890 changed files with 82290 additions and 0 deletions

14
mower/utils/traceback.py Normal file
View file

@ -0,0 +1,14 @@
from inspect import getframeinfo, stack
from pathlib import Path
from mower.utils.path import get_path
def caller_info():
caller = getframeinfo(stack()[2][0])
relative_name = Path(caller.filename)
try:
relative_name = relative_name.relative_to(get_path("@install"))
except ValueError:
pass
return f"{relative_name}:{caller.lineno}"