改写战斗中替换group的逻辑
This commit is contained in:
commit
7f89eb0db8
3890 changed files with 82290 additions and 0 deletions
14
mower/utils/traceback.py
Normal file
14
mower/utils/traceback.py
Normal 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}"
|
Loading…
Add table
Add a link
Reference in a new issue