INNER CODE UNIT · Python
find_all_dashboard_dirs
1186258278/OpenClawChineseTranslation · scripts/inject_panel.py:46
def find_all_dashboard_dirs():
"""查找所有存在的 Dashboard 目录"""
found_dirs = []
for name, paths in DASHBOARD_DIRS:
for path in paths:
if os.path.exists(path) and is_dashboard_dir(path):
found_dirs.append((name, path))
break # 每个类型只取第一个存在的路径
return found_dirs
def read_file(path):
"""读取文件内容"""
with open(path, 'r', encoding='utf-8') as f:
return f.read()
def write_file(path, content):