feat(497-0 [초기화] 서버): B07 · B08 · B09 reset 창구 셋 — 그 페이지 사용자 값 · 설정 지움 · 올린 파일 남김 · 단계 = 저장
- B07 POST /design-drawings/reset — 저장본 확정 풂(번호 · json 남김) · B07 이 올린 측점 확정 → 잠정 · 축척 · 횡단 배치 · 평면도 종류 · 표식 파일 지움 · 새 _Router_Reset.py(main.py 물림) - B08 POST /quantity/reset — quantity 설정 구획 기본 · hydro_inputs 지움 · milestone 기본(사용자 그림 붙은 거래처 경로 줄만 남김 · to = 시점) · 1본 길이 · 그림 남김 - B09 POST /estimation/reset — 사용자 값 · 단가 책 · estimation 설정 구획 지움 · 안 쓰는 서고 사본 정리 · 견적서 남김 · 답 = GET 꼴 - 공용 reset_section(구획 하나 기본으로) · 새 시험 test_298_2_page_reset Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -251,6 +251,17 @@ def save_section(
|
||||
return settings
|
||||
|
||||
|
||||
def reset_section(project_root: str | Path, section: str) -> None:
|
||||
"""한 구획을 기본값으로 — 페이지 [초기화](요구 298-2 C3) · 남의 구획 · 파일 없음 = 그대로."""
|
||||
if section not in SECTIONS:
|
||||
raise ValueError(f"모르는 구획: {section} (쓸 수 있는 것: {', '.join(SECTIONS)})")
|
||||
if not settings_path(project_root).exists():
|
||||
return
|
||||
settings = load_settings(project_root)
|
||||
settings[section] = default_settings()[section]
|
||||
atomic_write_json(settings_path(project_root), settings)
|
||||
|
||||
|
||||
def quantity_settings(project_root: str | Path) -> dict[str, Any]:
|
||||
"""B08 구획만 꺼낸다."""
|
||||
return load_settings(project_root).get("quantity") or {}
|
||||
|
||||
Reference in New Issue
Block a user