Files
34047007@qq.com b95053c52c init: 初始化 dpb 桃育种系统代码库
前后端 + 后端 FastAPI 全量源码、部署脚本与文档。
2026-08-06 00:17:49 +08:00

23 lines
630 B
Python

"""育种审计抑制标志(批量导入路径抑制逐行审计,仅汇总记一条)。"""
from contextvars import ContextVar
from typing import Any
_suppress: ContextVar[bool] = ContextVar("bre_audit_suppress", default=False)
def bre_audit_suppressed() -> bool:
return _suppress.get()
class bre_audit_suppress:
"""上下文管理器:with 块内 CRUDBase 写方法跳过逐行审计。"""
def __enter__(self) -> "bre_audit_suppress":
self._token: Any = _suppress.set(True)
return self
def __exit__(self, *exc: Any) -> bool:
_suppress.reset(self._token)
return False