创建调试控制器 / Create debug controller Args: read_path: 图片目录(或单个图片文件)路径。连接时加载所有图片,截图时轮播。 Path to a directory of images (or a single image file). Images are loaded on connect and cycled on screencap. Raises: Runtime
(
self,
read_path: Union[str, Path],
)
| 1065 | Debug controller that cycles through images from a directory""" |
| 1066 | |
| 1067 | def __init__( |
| 1068 | self, |
| 1069 | read_path: Union[str, Path], |
| 1070 | ): |
| 1071 | """创建调试控制器 / Create debug controller |
| 1072 | |
| 1073 | Args: |
| 1074 | read_path: 图片目录(或单个图片文件)路径。连接时加载所有图片,截图时轮播。 |
| 1075 | |
| 1076 | Path to a directory of images (or a single image file). Images are loaded on |
| 1077 | connect and cycled on screencap. |
| 1078 | |
| 1079 | Raises: |
| 1080 | RuntimeError: 如果创建失败 |
| 1081 | """ |
| 1082 | super().__init__() |
| 1083 | self._set_dbg_api_properties() |
| 1084 | |
| 1085 | self._handle = Library.framework().MaaDbgControllerCreate( |
| 1086 | str(read_path).encode(), |
| 1087 | ) |
| 1088 | |
| 1089 | if not self._handle: |
| 1090 | raise RuntimeError("Failed to create dbg controller.") |
| 1091 | |
| 1092 | def _set_dbg_api_properties(self): |
| 1093 | Library.framework().MaaDbgControllerCreate.restype = MaaControllerHandle |
nothing calls this directly
no test coverage detected