Merge branch 'sub_laptop_1' of C:/Aislo_wt/sub_laptop_1 into main_laptop_1
This commit is contained in:
@@ -9,6 +9,7 @@ M01 수식 문서 길과 같은 꼴: 읽기 {문서, 셈} · 미리 셈 {문서}
|
||||
단가갱신 = 값 줄만 지금 M01(문서 그대로).
|
||||
가져온 식 SK(807-1) = 가져온 줄 문서 · 셈 = 단가기준(엑셀 값 · 연결 값) · 부름 · 끊음 없음
|
||||
(형제 SK 는 셈 때 읽음) · 단가갱신 = 문서 그대로 · 바탕 참조 SK = 값 사본 없음(400).
|
||||
저장 전 문서(836-5 · 불러오기 미리 보기 835-1) = 몸 `본`(그 SK 문서째) — 파일 안 읽음 · 안 씀 · 읽기 · 미리 셈만(`read_memory`).
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
@@ -105,6 +106,20 @@ def read(key: str) -> dict[str, Any]:
|
||||
return out
|
||||
|
||||
|
||||
def read_memory(sk: Any) -> dict[str, Any]:
|
||||
"""저장 전 문서 읽기(836-5) — 몸 `본` 그대로 셈 · {read 꼴 · 판 = 빈 글} · 디스크 쓰기 0."""
|
||||
doc = _mem(sk)
|
||||
return {**answer(current(doc), doc), "판": ""}
|
||||
|
||||
|
||||
def _mem(raw: Any) -> dict:
|
||||
if not isinstance(raw, dict):
|
||||
raise _bad("본 · 묶음 아님")
|
||||
if len(json.dumps(raw, ensure_ascii=False, default=str).encode("utf-8")) > MAX:
|
||||
raise _bad("본 · 너무 큼")
|
||||
return raw
|
||||
|
||||
|
||||
# ── 몸 검사 ───────────────────────────────────────────────────────────
|
||||
def _doc(raw: Any, key: str, where: str) -> dict:
|
||||
if not isinstance(raw, dict):
|
||||
@@ -166,7 +181,11 @@ def preview(key: str, body: dict) -> dict[str, Any]:
|
||||
|
||||
|
||||
def _preview(key: str, body: dict) -> dict[str, Any]:
|
||||
doc = _file(key)["문서"]
|
||||
if body.get("본") is not None: # 저장 전 문서(836-5) — 파일 아님
|
||||
doc = _mem(body["본"])
|
||||
key = str(doc.get("키") or "")
|
||||
else:
|
||||
doc = _file(key)["문서"]
|
||||
mine = _basis(doc, body)
|
||||
before = current(doc)
|
||||
job = body.get("할일") or None
|
||||
|
||||
Reference in New Issue
Block a user