INNER CODE UNIT · Python
is_dashboard_dir
1186258278/OpenClawChineseTranslation · scripts/inject_panel.py:41
def is_dashboard_dir(path):
"""检查是否是 Dashboard 目录(包含 index.html)"""
index_html = os.path.join(path, 'index.html')
return os.path.isfile(index_html)
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):