From 4b3e9016beb9b24a3c92beacb7e3b0139826a715 Mon Sep 17 00:00:00 2001 From: umsangdon Date: Wed, 4 Nov 2026 11:51:33 +0900 Subject: [PATCH] =?UTF-8?q?feat(776-2):=20=EC=8B=A4=EB=AC=B4=EC=9E=90?= =?UTF-8?q?=EB=A3=8C=20HP=20=EC=97=90=20=EC=9D=BD=EA=B8=B0=20=EA=BC=B4=20?= =?UTF-8?q?=ED=8C=90=20=EC=B0=8D=EC=9D=8C=20=E2=80=94=20=EB=8B=A4=EB=A5=B8?= =?UTF-8?q?=20=ED=8C=90=20=3D=20=EC=A7=80=EB=82=9C=20=EA=B2=83(=EB=AA=A9?= =?UTF-8?q?=EB=A1=9D=20=EC=88=A8=EA=B9=80=20=C2=B7=20=EB=8B=A4=EC=9D=8C=20?= =?UTF-8?q?=EC=98=AC=EB=A6=BC=20=EB=95=8C=20=EB=81=9D=EB=83=84)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Store.BOOK = 2 · save 가 「판」 찍음 · stale = 하루 지남 또는 판 다름 - 작업 중 열기 409 「다시 올림」은 Forget.finish 옛 판 읽기 한 줄과 함께(받기 뒤) - 시험 test_718_1 판 지킴 한 개 Co-Authored-By: Claude Opus 5.5 --- M02_MasterTemplete/M02_Hopyo_Store.py | 8 +++++++- resources/tester/test_718_1_hopyo_import.py | 7 +++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/M02_MasterTemplete/M02_Hopyo_Store.py b/M02_MasterTemplete/M02_Hopyo_Store.py index 53ef5ead8..6e3b45f85 100644 --- a/M02_MasterTemplete/M02_Hopyo_Store.py +++ b/M02_MasterTemplete/M02_Hopyo_Store.py @@ -7,6 +7,8 @@ 한시 불러오기(718-1 · 743-1) — 파일에 `지문`(올린 엑셀 sha256) · 목록 = 지문 있고 하루 안 지난 것 (작업 중)만 · 옛 HP · 하루 지난 HP 는 목록에서 숨김(지움 = `M02_Hopyo_Forget`) · `실무자료/불러옴.json` `{번}` = 낸 키 가장 큰 번(지운 뒤에도 키를 다시 안 씀 · 옛 `지문` 안 읽음). +판(776-2) = 읽기 꼴(Book) 판 `BOOK` 을 HP 에 찍음 · 다른 판 = 지난 것(목록에서 숨김 · +다음 올림 때 끝냄 · 옛 꼴 읽기 갈래 없음 — 다시 올림). """ from __future__ import annotations @@ -29,6 +31,7 @@ GRID = "격자" DONE = "불러옴" NO_GRID = "격자 없음 — 다시 올리면 보임" EXPIRE = timedelta(days=1) # 작업 중 HP 보관 — 올린 뒤 하루 +BOOK = 2 # 읽기 꼴(Book) 판 — 읽기 · 정규화 출력 꼴을 바꾸면 올림 _KEY = re.compile(r"^HP-(\d{6})$") # ponytail: 프로세스 안 잠금 — 서버를 여럿 띄우면 파일 잠금으로 _LOCK = threading.Lock() @@ -71,7 +74,9 @@ def fingerprint(data: bytes) -> str: def stale(doc: dict[str, Any], now: datetime | None = None) -> bool: - """하루 지난 HP — 올린때 기준 · 못 읽는 때 = 지난 것.""" + """하루 지난 HP · 다른 판 HP — 올린때 기준 · 못 읽는 때 = 지난 것.""" + if doc.get("판") != BOOK: + return True try: when = datetime.fromisoformat(str(doc.get("올린때") or "").replace("Z", "+00:00")) except ValueError: @@ -131,6 +136,7 @@ def save( "올린이": who, **({"지문": mark} if mark else {}), **parsed, + "판": BOOK, } if grid is not None: book = {**grid["책"], "열": key} diff --git a/resources/tester/test_718_1_hopyo_import.py b/resources/tester/test_718_1_hopyo_import.py index 044b1efe2..7030cff19 100644 --- a/resources/tester/test_718_1_hopyo_import.py +++ b/resources/tester/test_718_1_hopyo_import.py @@ -91,3 +91,10 @@ def test_결과_단가산출_산근_블록_기초_SK_고름대기_겹침_없음( assert res["만든"] == len(docs) # 같은 내용 SK 한 벌 — 사본 걷은 문서 수 assert len(list((folder / "sangeun").glob("SK-*.json"))) == len(docs) # 남음 assert _post(client).status_code == 200 # 743-1 — 다시 올림 됨 + + +def test_판_다른_HP_지난_것(): + """776-2 — 읽기 꼴 판이 다르면(옛 판 · 판 없음) 막 올렸어도 지난 것 = 목록 숨김 · 다음 올림 때 끝냄.""" + now = {"올린때": "2999-01-01T00:00:00Z"} + assert hs.stale({**now, "판": hs.BOOK}, now=None) is False + assert hs.stale(now) and hs.stale({**now, "판": hs.BOOK - 1})