Files
ChouJuGEO/scripts/reorganize_files.py
T
刘国栋 8f7f082c3d feat: 重构项目结构并添加平台同步基础架构
- 重构项目目录结构,将功能模块移至 modules/ 目录
- 创建平台同步基础架构,包括发布器基类和 GitHub 发布器
- 新增 UI 状态管理模块 (modules/ui/state.py) 统一管理会话状态
- 更新依赖配置,添加平台同步所需依赖 (httpx, pyperclip)
- 整理文档结构,将所有文档分类移至 docs/ 目录
- 添加 .cursorrules 文件定义项目开发规范
- 清理根目录重复文件,保持项目结构整洁
2026-01-30 10:21:29 +08:00

137 lines
4.0 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""
临时脚本:重组项目文件结构
"""
import os
import shutil
from pathlib import Path
# 项目根目录
root = Path(__file__).parent
# 文档分类映射
doc_mapping = {
# 功能文档
"features": [
"*_FEATURE.md"
],
# 分析报告
"analysis": [
"ANALYSIS_ACCURACY_REPORT.md",
"CODE_DOCUMENTATION_ANALYSIS.md",
"DOCUMENTATION_REVERSE_VERIFICATION.md",
"FEATURE_ANALYSIS.md",
"FEATURE_PRIORITY_ANALYSIS.md",
"FUNCTION_VERIFICATION_REPORT.md",
"GEO_COMPLIANCE_ANALYSIS.md",
],
# 指南文档
"guides": [
"QUICK_START_GUIDE.md",
"STORAGE_GUIDE.md",
"PLATFORM_SETUP.md",
"LAYOUT_UPGRADE_GUIDE.md",
"DECISION_GUIDE.md",
],
# 实现文档
"implementation": [
"IMPLEMENTATION_SUMMARY.md",
"PLATFORM_SYNC_ANALYSIS.md",
"PLATFORM_SYNC_IMPLEMENTATION.md",
"PLATFORM_SYNC_TEST.md",
"INTEGRATION_NOTES.md",
"FEATURES_COMPLETE_LIST.md",
"ADVANCED_FEATURES.md",
],
}
# 功能模块文件列表
module_files = [
"data_storage.py",
"keyword_tool.py",
"content_scorer.py",
"eeat_enhancer.py",
"semantic_expander.py",
"fact_density_enhancer.py",
"schema_generator.py",
"topic_cluster.py",
"multimodal_prompt.py",
"roi_analyzer.py",
"workflow_automation.py",
"keyword_mining.py",
"optimization_techniques.py",
"content_metrics.py",
"technical_config_generator.py",
"negative_monitor.py",
"resource_recommender.py",
"config_optimizer.py",
"storage_example.py",
]
def move_files():
"""移动文件到对应目录"""
moved_count = 0
# 移动功能文档(*_FEATURE.md
features_dir = root / "docs" / "features"
features_dir.mkdir(parents=True, exist_ok=True)
for file in root.glob("*_FEATURE.md"):
try:
dest = features_dir / file.name
if not dest.exists():
shutil.move(str(file), str(dest))
print(f"✓ Moved {file.name} -> docs/features/")
moved_count += 1
else:
print(f"⚠ Skipped {file.name} (already exists)")
except Exception as e:
print(f"✗ Failed to move {file.name}: {e}")
# 移动其他文档
for category, files in doc_mapping.items():
if category == "features":
continue # 已经处理过了
target_dir = root / "docs" / category
target_dir.mkdir(parents=True, exist_ok=True)
for filename in files:
src = root / filename
if src.exists():
try:
dest = target_dir / filename
if not dest.exists():
shutil.move(str(src), str(dest))
print(f"✓ Moved {filename} -> docs/{category}/")
moved_count += 1
else:
print(f"⚠ Skipped {filename} (already exists)")
except Exception as e:
print(f"✗ Failed to move {filename}: {e}")
else:
print(f"⚠ File not found: {filename}")
# 移动功能模块
modules_dir = root / "modules"
modules_dir.mkdir(parents=True, exist_ok=True)
for filename in module_files:
src = root / filename
if src.exists():
try:
dest = modules_dir / filename
if not dest.exists():
shutil.move(str(src), str(dest))
print(f"✓ Moved {filename} -> modules/")
moved_count += 1
else:
print(f"⚠ Skipped {filename} (already exists)")
except Exception as e:
print(f"✗ Failed to move {filename}: {e}")
else:
print(f"⚠ File not found: {filename}")
print(f"\n✅ Total moved: {moved_count} files")
if __name__ == "__main__":
move_files()