auto: 2026-11-18 07:18 (ESD_LAPTOP)
This commit is contained in:
@@ -11,7 +11,6 @@ M01 에서 만든 기계(출처 모두 「자체」)를 지우면 그 번호 기
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import copy
|
||||
from decimal import Decimal
|
||||
from typing import Any, Callable
|
||||
|
||||
@@ -118,20 +117,10 @@ def formula(row: dict) -> dict:
|
||||
return base | ({"키": got["키"], "이름": got.get("이름")} if got else {})
|
||||
|
||||
|
||||
def _family_files() -> dict[str, str]:
|
||||
"""기계경비식 키 → 로직 파일 이름."""
|
||||
return {
|
||||
str(r.get("키")): name
|
||||
for name, data in store.loaded()[0].items()
|
||||
if data.get("그룹") == "로직" and "건설기계" in name
|
||||
for r in data.get("줄") or []
|
||||
}
|
||||
|
||||
|
||||
def register(batch: list[dict]) -> Callable[[], None]:
|
||||
"""[새 기계] 저장 = 꼴 식 「기계」 목록에 그 원문번호 더함 · M01 에서 만든 기계(출처 모두 「자체」)를
|
||||
지우면 같은 번호 기계가 더 없을 때 목록에서 뺌 — 로직 파일 고침을 같은 저장 묶음에 붙임(정본 저장 길) ·
|
||||
돌려준 함수 = 저장 뒤 수식 문서 기계 고르기 목록에도 같은 더함 · 뺌(848-5 · 두 목록 한 벌)."""
|
||||
지우면 같은 번호 기계가 더 없을 때 목록에서 뺌 — 돌려준 함수 = 저장 뒤 수식 문서 기계 고르기 목록(정본 ·
|
||||
848-5)에 더함 · 뺌 + 옛 로직 줄 고르기 같이 쓰기(`Store_Logic.mirror` · 855 L3 ⓐ)."""
|
||||
from M02_MasterTemplete import M02_Machine_Hourly as mh # M02 가 M01 을 부름 — 늦게
|
||||
from M02_MasterTemplete import M02_MyMachine as mym
|
||||
|
||||
@@ -162,23 +151,13 @@ def register(batch: list[dict]) -> Callable[[], None]:
|
||||
drop.add(code)
|
||||
if not add and not drop:
|
||||
return lambda: None
|
||||
files = _family_files()
|
||||
for name in dict.fromkeys(files.values()):
|
||||
changes = []
|
||||
for logic in store.read(name)[0].get("줄") or []:
|
||||
ins = logic.get("입력") or []
|
||||
pick = next((i for i in ins if i.get("이름") == "기계" and "고르기" in i), None)
|
||||
if pick is None:
|
||||
continue
|
||||
codes = [c for c in pick["고르기"] if str(c) not in drop]
|
||||
codes += [c for c in add.get(str(logic["키"]), []) if c not in codes]
|
||||
if codes != pick["고르기"]:
|
||||
new = copy.deepcopy(logic)
|
||||
next(i for i in new["입력"] if i.get("이름") == "기계")["고르기"] = codes
|
||||
changes.append({"op": "edit", "key": logic["키"], "row": new})
|
||||
if changes:
|
||||
batch.append({"file": name, "version": store.read(name)[1], "changes": changes})
|
||||
after = lambda: _register_docs(add, drop) # noqa: E731
|
||||
|
||||
def after() -> None:
|
||||
from M01_MasterData import M01_MasterData_Store_Logic as logic_store # 늦게(서로 부름)
|
||||
|
||||
_register_docs(add, drop)
|
||||
logic_store.mirror([], (add, drop))
|
||||
|
||||
after.lists = (
|
||||
add,
|
||||
drop,
|
||||
|
||||
Reference in New Issue
Block a user