模块 nonebot_plugin_marshoai.plugin.utils
func path_to_module_name(path: Path) -> str
说明: 转换路径为模块名
参数:
- path: 路径a/b/c/d -> a.b.c.d
返回: str: 模块名
源代码 或 在GitHub上查看
python
def path_to_module_name(path: Path) -> str:
rel_path = path.resolve().relative_to(Path.cwd().resolve())
if rel_path.stem == '__init__':
return '.'.join(rel_path.parts[:-1])
else:
return '.'.join(rel_path.parts[:-1] + (rel_path.stem,))
func parse_function_docsring()
源代码 或 在GitHub上查看
python
def parse_function_docsring():
pass