python-hwpx 6.12.0__py3-none-any.whl → 7.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- hwpx/__init__.py +114 -65
- hwpx/_document/_legacy.py +74 -1752
- hwpx/_document/_resolve.py +115 -24
- hwpx/_document/_units.py +26 -0
- hwpx/_document/fields.py +881 -51
- hwpx/_document/headings.py +5 -13
- hwpx/_document/highlight.py +64 -5
- hwpx/_document/layout.py +311 -222
- hwpx/_document/media.py +254 -81
- hwpx/_document/memos.py +249 -57
- hwpx/_document/ns/_base.py +75 -4
- hwpx/_document/ns/fields.py +170 -20
- hwpx/_document/ns/media.py +32 -15
- hwpx/_document/ns/notes.py +121 -42
- hwpx/_document/ns/page.py +817 -140
- hwpx/_document/ns/parts.py +262 -84
- hwpx/_document/ns/refs.py +123 -19
- hwpx/_document/ns/shapes.py +198 -122
- hwpx/_document/ns/styles.py +536 -175
- hwpx/_document/ns/tables.py +87 -47
- hwpx/_document/ns/text.py +313 -77
- hwpx/_document/ns/tracking.py +67 -16
- hwpx/_document/persistence.py +523 -198
- hwpx/_document/shapes.py +183 -119
- hwpx/_document/text_blocks.py +529 -3
- hwpx/_document/tracked.py +420 -11
- hwpx/_moved_modules.py +223 -17
- hwpx/_removed_names.py +1235 -0
- hwpx/capabilities.py +54 -79
- hwpx/data/contract_docs/known-traps.md +29 -12
- hwpx/data/contract_docs/mutation-semantics.md +14 -11
- hwpx/data/contract_docs/recipes-traversal.md +8 -8
- hwpx/data/contract_docs/support-matrix.md +28 -28
- hwpx/document.py +431 -266
- hwpx/equation/__init__.py +19 -26
- hwpx/equation/authoring.py +358 -26
- hwpx/equation/eqedit.py +163 -15
- hwpx/equation/measure.py +208 -42
- hwpx/equation/tokens.py +84 -0
- hwpx/errors.py +366 -38
- hwpx/experimental.py +33 -41
- hwpx/form_fit/__init__.py +7 -1
- hwpx/form_fit/measure.py +4 -2
- hwpx/hwp5/cfb.py +37 -0
- hwpx/hwp5/docinfo.py +8 -6
- hwpx/hwp5/docinfo_writer.py +12 -7
- hwpx/hwp5/header_xml.py +75 -18
- hwpx/hwp5/owpml.py +7 -0
- hwpx/hwp5/package.py +79 -9
- hwpx/hwp5/reader.py +3 -5
- hwpx/hwp5/records.py +19 -5
- hwpx/hwp5/section_writer.py +21 -0
- hwpx/hwp5/section_xml.py +170 -30
- hwpx/hwp5/shape_xml.py +2 -2
- hwpx/layout/_page_measure.py +10 -3
- hwpx/layout/lint.py +5 -5
- hwpx/model.py +7 -1
- hwpx/mutation_report.py +123 -14
- hwpx/objects/__init__.py +209 -7
- hwpx/objects/binary_item.py +5 -29
- hwpx/objects/checkbox.py +299 -10
- hwpx/objects/form_field.py +771 -2
- hwpx/objects/highlight.py +248 -6
- hwpx/objects/results.py +817 -8
- hwpx/opc/package.py +925 -142
- hwpx/opc/security.py +273 -11
- hwpx/opc/xml_utils.py +197 -8
- hwpx/opc/zip_records.py +262 -0
- hwpx/oxml/__init__.py +5 -2
- hwpx/oxml/_document_impl.py +1 -1
- hwpx/oxml/_document_primitives.py +424 -99
- hwpx/oxml/_paragraph_text_edit.py +1314 -32
- hwpx/oxml/caret.py +169 -0
- hwpx/oxml/container.py +867 -26
- hwpx/oxml/curves.py +71 -13
- hwpx/oxml/document_metadata.py +52 -4
- hwpx/oxml/document_parts.py +243 -134
- hwpx/oxml/drop_cap.py +7 -5
- hwpx/oxml/dutmal_compose.py +240 -2
- hwpx/oxml/field_marks.py +181 -18
- hwpx/oxml/formatting.py +1640 -0
- hwpx/oxml/header.py +90 -24
- hwpx/oxml/header_fonts.py +180 -33
- hwpx/oxml/header_part.py +278 -99
- hwpx/oxml/hyperlink_form.py +117 -1
- hwpx/oxml/master_page_authoring.py +79 -4
- hwpx/oxml/memo.py +662 -57
- hwpx/oxml/namespaces.py +41 -0
- hwpx/oxml/note_authoring.py +434 -22
- hwpx/oxml/numbering.py +2 -13
- hwpx/oxml/numbering_kinds.py +394 -3
- hwpx/oxml/objects.py +568 -204
- hwpx/oxml/paragraph.py +588 -207
- hwpx/oxml/paragraph_heading.py +50 -0
- hwpx/oxml/run.py +865 -49
- hwpx/oxml/section.py +512 -62
- hwpx/oxml/section_format.py +311 -215
- hwpx/oxml/section_layout.py +4 -2
- hwpx/oxml/section_story.py +216 -67
- hwpx/oxml/shape_position.py +2600 -61
- hwpx/oxml/simple_parts.py +86 -0
- hwpx/oxml/table.py +210 -144
- hwpx/oxml/table_format.py +1048 -0
- hwpx/oxml/table_merge.py +64 -1
- hwpx/oxml/table_rows.py +280 -0
- hwpx/oxml/table_sizes.py +508 -2
- hwpx/oxml/table_structure.py +135 -16
- hwpx/oxml/text_offsets.py +104 -0
- hwpx/oxml/text_ranges.py +1506 -0
- hwpx/oxml/utils.py +39 -2
- hwpx/patch.py +268 -207
- hwpx/quality/__init__.py +4 -4
- hwpx/quality/policy.py +1 -1
- hwpx/quality/save_pipeline.py +155 -28
- hwpx/table_patch.py +20 -9
- hwpx/tools/__init__.py +15 -91
- hwpx/tools/archive_cli.py +76 -0
- hwpx/tools/doc_diff.py +20 -125
- hwpx/tools/document_merge.py +601 -77
- hwpx/tools/exporter.py +194 -181
- hwpx/tools/generic_inventory.py +2 -0
- hwpx/tools/ir_equality.py +9 -2
- hwpx/tools/package_validator.py +122 -31
- hwpx/tools/page_guard.py +11 -1
- hwpx/tools/redline.py +15 -5
- hwpx/tools/repair.py +70 -1
- hwpx/tools/table_navigation.py +14 -274
- hwpx/tools/template_analyzer.py +7 -2
- hwpx/tools/text_extract_cli.py +92 -24
- hwpx/tools/text_extractor.py +27 -7
- hwpx/tools/toc_author.py +459 -13
- hwpx/tools/validator.py +51 -11
- {python_hwpx-6.12.0.dist-info → python_hwpx-7.0.0.dist-info}/METADATA +81 -59
- python_hwpx-7.0.0.dist-info/RECORD +204 -0
- {python_hwpx-6.12.0.dist-info → python_hwpx-7.0.0.dist-info}/entry_points.txt +0 -1
- hwpx/equation/mathml.py +0 -157
- hwpx/equation/render.py +0 -83
- hwpx/ingest/__init__.py +0 -26
- hwpx/ingest/base.py +0 -236
- hwpx/ingest/hwpx_converter.py +0 -290
- hwpx/tools/document_viewer.py +0 -182
- hwpx/tools/format_rules.py +0 -530
- hwpx/tools/layout_preview.py +0 -752
- hwpx/tools/mail_merge.py +0 -518
- hwpx/tools/markdown_export.py +0 -647
- hwpx/tools/markdown_import.py +0 -473
- hwpx/tools/report_utils.py +0 -132
- hwpx/tools/table_cleanup.py +0 -61
- python_hwpx-6.12.0.dist-info/RECORD +0 -209
- {python_hwpx-6.12.0.dist-info → python_hwpx-7.0.0.dist-info}/WHEEL +0 -0
- {python_hwpx-6.12.0.dist-info → python_hwpx-7.0.0.dist-info}/licenses/LICENSE +0 -0
- {python_hwpx-6.12.0.dist-info → python_hwpx-7.0.0.dist-info}/licenses/NOTICE +0 -0
- {python_hwpx-6.12.0.dist-info → python_hwpx-7.0.0.dist-info}/top_level.txt +0 -0
hwpx/__init__.py
CHANGED
|
@@ -6,8 +6,10 @@
|
|
|
6
6
|
|
|
7
7
|
- **stable** — ``__all__``에 있는 이름. 계약이 굳었고 major 경계에서만 깨질 수 있음.
|
|
8
8
|
- **experimental** — 계약이 유동적. ``from hwpx.experimental import ...``로 쓰세요.
|
|
9
|
-
최상위
|
|
10
|
-
|
|
9
|
+
4.0~6.x의 최상위 재내보내기(경고와 함께)는 7.0에서 없어졌습니다 — ``from hwpx import
|
|
10
|
+
<실험 기능>``은 ``hwpx.experimental``을 알려 주는 ``MovedToExperimental``(ImportError)을 냅니다.
|
|
11
|
+
수식 변환(``latex_to_eqedit`` 등)은 7.0에서 ``hwpx.equation``의 stable 이름이 되었고, 최상위
|
|
12
|
+
접근은 ``hwpx.equation``을 알려 주는 ``MovedToSubmodule``(ImportError)을 냅니다.
|
|
11
13
|
- **deprecated** — 대체 경로로 이전하세요. 접근 시 ``DeprecationWarning``이 납니다.
|
|
12
14
|
"""
|
|
13
15
|
|
|
@@ -26,36 +28,24 @@ def _resolve_version() -> str:
|
|
|
26
28
|
return "0+unknown"
|
|
27
29
|
|
|
28
30
|
|
|
29
|
-
# --- experimental / deprecated 최상위 표면
|
|
31
|
+
# --- experimental / deprecated 최상위 표면 ----------------------------------------
|
|
30
32
|
#
|
|
31
33
|
# stable 이름은 경고 없이 해석됩니다. 대부분 아래에서 eager import 되고, ``hwpx.tools``의
|
|
32
|
-
# 이름은 ``_TOOLS_STABLE_EXPORTS``가 지연 해석합니다.
|
|
33
|
-
#
|
|
34
|
+
# 이름은 ``_TOOLS_STABLE_EXPORTS``가 지연 해석합니다.
|
|
35
|
+
#
|
|
36
|
+
# ``_EXPERIMENTAL_EXPORTS``는 4.0~6.x가 최상위에서 경고와 함께 재내보내던 실험 기능
|
|
37
|
+
# 가운데 엔진에 남아 지금도 실험 기능인 11개다. 7.0은 예고대로 그 재내보내기를 지웠다.
|
|
38
|
+
# 표는 남아 오류 메시지 하나를 만든다 — ``from hwpx import estimate_pages``가
|
|
39
|
+
# ``hwpx.experimental``을 알려 준다(``MovedToExperimental``). 구현 모듈 경로는 그대로다.
|
|
40
|
+
# 수식 변환 3개는 7.0에서 ``hwpx.equation``의 stable 이름이 되어 ``_EQUATION_EXPORTS``로
|
|
41
|
+
# 갔고(D26), 나머지 12개(ingest 7개, 미리보기 5개)는 7.0에서 python-hwpx-automation으로 옮겨
|
|
42
|
+
# ``_MOVED_TO_COMPANION``에 있다.
|
|
34
43
|
|
|
35
44
|
_EXPERIMENTAL_EXPORTS = {
|
|
36
|
-
# 문서 ingestion 프레임워크(임의 포맷 -> HWPX). 계약 유동.
|
|
37
|
-
"ConversionAttempt": "hwpx.ingest",
|
|
38
|
-
"DocumentConverter": "hwpx.ingest",
|
|
39
|
-
"DocumentIngestError": "hwpx.ingest",
|
|
40
|
-
"DocumentIngestResult": "hwpx.ingest",
|
|
41
|
-
"DocumentIngestor": "hwpx.ingest",
|
|
42
|
-
"DocumentSourceInfo": "hwpx.ingest",
|
|
43
|
-
"UnsupportedDocumentFormat": "hwpx.ingest",
|
|
44
|
-
# 레이아웃 프리뷰(한컴 없는 정직 근사). 계약 유동.
|
|
45
|
-
"LayoutPreview": "hwpx.tools.layout_preview",
|
|
46
|
-
"PreviewPage": "hwpx.tools.layout_preview",
|
|
47
|
-
"render_layout_preview": "hwpx.tools.layout_preview",
|
|
48
45
|
# 쪽 수 추정(한/글 없이, 줄마다 쪽·단·세로 위치). 계약 유동.
|
|
49
46
|
"EstimatedLine": "hwpx.layout.pages",
|
|
50
47
|
"PageEstimate": "hwpx.layout.pages",
|
|
51
48
|
"estimate_pages": "hwpx.layout.pages",
|
|
52
|
-
# 문서 프리뷰 뷰어(3.8.0 신규). 계약 유동.
|
|
53
|
-
"DocumentViewer": "hwpx.tools.document_viewer",
|
|
54
|
-
"render_document_viewer": "hwpx.tools.document_viewer",
|
|
55
|
-
# 수식 저작(5.2.0 신규, LaTeX -> EqEdit). 계약 유동.
|
|
56
|
-
"UnsupportedLatexError": "hwpx.equation.authoring",
|
|
57
|
-
"estimate_equation_size": "hwpx.equation.authoring",
|
|
58
|
-
"latex_to_eqedit": "hwpx.equation.authoring",
|
|
59
49
|
# 편집 계획 실행기(5.6.0 신규, 선언적 다단 편집 -> 원자 실행). 계약 유동.
|
|
60
50
|
"EditPlan": "hwpx.plan",
|
|
61
51
|
"PlanReport": "hwpx.plan",
|
|
@@ -70,6 +60,15 @@ _EXPERIMENTAL_EXPORTS = {
|
|
|
70
60
|
"contract_json_schema": "hwpx.capabilities",
|
|
71
61
|
}
|
|
72
62
|
|
|
63
|
+
# 4.0~6.x가 최상위에서 실험 기능으로 재내보내던 수식 변환(5.2.0 신규, LaTeX -> EqEdit).
|
|
64
|
+
# 7.0에서 ``hwpx.equation``의 stable 이름이 되었고 최상위에는 넣지 않는다(D26). 최상위
|
|
65
|
+
# 접근은 ``hwpx.equation``을 알려 준다(``MovedToSubmodule``).
|
|
66
|
+
_EQUATION_EXPORTS: dict[str, str] = {
|
|
67
|
+
"UnsupportedLatexError": "hwpx.equation",
|
|
68
|
+
"estimate_equation_size": "hwpx.equation",
|
|
69
|
+
"latex_to_eqedit": "hwpx.equation",
|
|
70
|
+
}
|
|
71
|
+
|
|
73
72
|
# Emptied in 5.0. The 4.x notice on these names said they would go in the next
|
|
74
73
|
# major, and this is it: analyze_template_formfit, apply_template_formfit and the
|
|
75
74
|
# two schema-version constants are gone with hwpx.template_formfit. Use
|
|
@@ -86,9 +85,17 @@ _FORMFIT_REPLACEMENT = (
|
|
|
86
85
|
|
|
87
86
|
def _experimental_message(name: str) -> str:
|
|
88
87
|
return (
|
|
89
|
-
f"'hwpx.{name}'는 실험적(experimental)
|
|
90
|
-
f"
|
|
91
|
-
f"
|
|
88
|
+
f"'hwpx.{name}'는 실험적(experimental) 표면이라 python-hwpx 7.0에서 최상위 "
|
|
89
|
+
f"재내보내기가 없어졌습니다(4.0부터 예고). 이렇게 가져오세요:\n"
|
|
90
|
+
f" from hwpx.experimental import {name}"
|
|
91
|
+
)
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
def _submodule_message(name: str, module: str) -> str:
|
|
95
|
+
return (
|
|
96
|
+
f"'hwpx.{name}'는 python-hwpx 7.0에서 {module}의 stable 이름이 되었고 최상위 "
|
|
97
|
+
f"재내보내기는 없습니다(4.0~6.x는 실험 기능으로 내보냈습니다). 이렇게 가져오세요:\n"
|
|
98
|
+
f" from {module} import {name}"
|
|
92
99
|
)
|
|
93
100
|
|
|
94
101
|
|
|
@@ -99,14 +106,15 @@ def _deprecated_message(name: str) -> str:
|
|
|
99
106
|
)
|
|
100
107
|
|
|
101
108
|
|
|
102
|
-
# --- 5.0에서 이동한 이름
|
|
109
|
+
# --- 5.0·7.0에서 이동한 이름 ---------------------------------------------
|
|
103
110
|
#
|
|
104
|
-
# 응용
|
|
105
|
-
# 그 패키지를 import하지 않는다. 설치돼 있는지에
|
|
106
|
-
# 의존 방향이 뒤집히고, 그건 5.0이 없애려던 바로 그 결합이다.
|
|
111
|
+
# 응용 워크플로(5.0)와 변환·짐작 기능(7.0)은 companion 패키지(python-hwpx-automation)가
|
|
112
|
+
# 소유한다. 여기 남는 것은 **표뿐**이다 — 그 패키지를 import하지 않는다. 설치돼 있는지에
|
|
113
|
+
# 따라 core의 동작이 달라지면 의존 방향이 뒤집히고, 그건 5.0이 없애려던 바로 그 결합이다.
|
|
107
114
|
#
|
|
108
115
|
# 표가 하는 일은 오류 메시지 하나다. 기본 Python 오류는 이름이 사라졌다는 것만
|
|
109
|
-
# 알려주고 어디로 갔는지는 말해주지 않는다.
|
|
116
|
+
# 알려주고 어디로 갔는지는 말해주지 않는다. 항목마다 옮겨 간 릴리스(``moved_in``)가 있어
|
|
117
|
+
# 문구와 안내 문서(migration-5.0.md / migration-7.0.md)가 그에 맞춰진다.
|
|
110
118
|
_SurfaceKind = Literal["symbol", "module", "renamed", "retired"]
|
|
111
119
|
|
|
112
120
|
|
|
@@ -118,6 +126,8 @@ class _CompanionSurface:
|
|
|
118
126
|
target_module: str | None = None
|
|
119
127
|
target_name: str | None = None
|
|
120
128
|
replacement: str | None = None
|
|
129
|
+
#: The release that moved the name (``"5.0"`` or ``"7.0"``).
|
|
130
|
+
moved_in: str = "5.0"
|
|
121
131
|
|
|
122
132
|
def import_statement(self, legacy_name: str) -> str | None:
|
|
123
133
|
if self.kind == "retired":
|
|
@@ -133,12 +143,18 @@ class _CompanionSurface:
|
|
|
133
143
|
return f"from {self.target_module} import {target_name}{alias}"
|
|
134
144
|
|
|
135
145
|
|
|
136
|
-
def _symbol(
|
|
137
|
-
|
|
146
|
+
def _symbol(
|
|
147
|
+
target_module: str, target_name: str | None = None, *, moved_in: str = "5.0"
|
|
148
|
+
) -> _CompanionSurface:
|
|
149
|
+
return _CompanionSurface("symbol", target_module, target_name, moved_in=moved_in)
|
|
150
|
+
|
|
138
151
|
|
|
152
|
+
def _module(target_module: str, *, moved_in: str = "5.0") -> _CompanionSurface:
|
|
153
|
+
return _CompanionSurface("module", target_module, moved_in=moved_in)
|
|
139
154
|
|
|
140
|
-
|
|
141
|
-
|
|
155
|
+
|
|
156
|
+
def _moved_in_7_0(target_module: str, *names: str) -> dict[str, _CompanionSurface]:
|
|
157
|
+
return {name: _symbol(target_module, moved_in="7.0") for name in names}
|
|
142
158
|
|
|
143
159
|
|
|
144
160
|
def _renamed(
|
|
@@ -241,6 +257,40 @@ _MOVED_TO_COMPANION: dict[str, _CompanionSurface] = {
|
|
|
241
257
|
),
|
|
242
258
|
"validate_document_plan": _symbol("hwpx_automation.office.authoring"),
|
|
243
259
|
"visual": _renamed("hwpx_automation.office.rendering"),
|
|
260
|
+
# -- 7.0: 변환·짐작 기능 (엔진은 파일에 적힌 대로 읽고 쓴다) -------------
|
|
261
|
+
"ingest": _module("hwpx_automation.ingest", moved_in="7.0"),
|
|
262
|
+
"integrations": _module("hwpx_automation.integrations", moved_in="7.0"),
|
|
263
|
+
**_moved_in_7_0(
|
|
264
|
+
"hwpx_automation.ingest",
|
|
265
|
+
"HwpxMarkdownConverter",
|
|
266
|
+
"ConversionAttempt",
|
|
267
|
+
"DocumentConverter",
|
|
268
|
+
"DocumentIngestError",
|
|
269
|
+
"DocumentIngestResult",
|
|
270
|
+
"DocumentIngestor",
|
|
271
|
+
"DocumentSourceInfo",
|
|
272
|
+
"UnsupportedDocumentFormat",
|
|
273
|
+
),
|
|
274
|
+
**_moved_in_7_0(
|
|
275
|
+
"hwpx_automation.mail_merge",
|
|
276
|
+
"MAIL_MERGE_REPORT_VERSION",
|
|
277
|
+
"inspect_mail_merge_placeholders",
|
|
278
|
+
"load_mail_merge_rows",
|
|
279
|
+
"merge_template_rows",
|
|
280
|
+
),
|
|
281
|
+
**_moved_in_7_0(
|
|
282
|
+
"hwpx_automation.office.compliance",
|
|
283
|
+
"REFERENCE_CONSISTENCY_REPORT_VERSION",
|
|
284
|
+
"inspect_reference_consistency",
|
|
285
|
+
),
|
|
286
|
+
**_moved_in_7_0(
|
|
287
|
+
"hwpx_automation.preview",
|
|
288
|
+
"DocumentViewer",
|
|
289
|
+
"LayoutPreview",
|
|
290
|
+
"PreviewPage",
|
|
291
|
+
"render_document_viewer",
|
|
292
|
+
"render_layout_preview",
|
|
293
|
+
),
|
|
244
294
|
}
|
|
245
295
|
|
|
246
296
|
_RETIRED_SURFACES: dict[str, _CompanionSurface] = {
|
|
@@ -286,6 +336,19 @@ class MovedToCompanion(ImportError):
|
|
|
286
336
|
"""
|
|
287
337
|
|
|
288
338
|
|
|
339
|
+
class MovedToSubmodule(ImportError):
|
|
340
|
+
"""최상위에서 빠진 이름에 접근했다(7.0). 메시지가 가리키는 하위 모듈에 있다
|
|
341
|
+
(수식 변환은 ``hwpx.equation``).
|
|
342
|
+
|
|
343
|
+
:class:`MovedToCompanion`과 같은 까닭으로 ImportError다 — ``from hwpx import X``가
|
|
344
|
+
메시지를 그대로 사용자에게 보여 준다.
|
|
345
|
+
"""
|
|
346
|
+
|
|
347
|
+
|
|
348
|
+
class MovedToExperimental(MovedToSubmodule):
|
|
349
|
+
"""최상위에서 빠진 실험 기능에 접근했다(7.0). ``hwpx.experimental``에 있다."""
|
|
350
|
+
|
|
351
|
+
|
|
289
352
|
class RetiredSurface(ImportError):
|
|
290
353
|
"""A removed compatibility surface whose replacement is not another import."""
|
|
291
354
|
|
|
@@ -294,7 +357,9 @@ def __getattr__(name: str) -> object:
|
|
|
294
357
|
"""Resolve dynamic module attributes.
|
|
295
358
|
|
|
296
359
|
``__version__``과 ``hwpx.tools``의 stable 이름은 경고 없이 지연 해석하고,
|
|
297
|
-
|
|
360
|
+
deprecated 이름은 해석 시 ``DeprecationWarning``을 냅니다. 7.0에서 최상위에서 빠진
|
|
361
|
+
실험 기능은 ``hwpx.experimental``을 알려 주는 ``MovedToExperimental``을, 수식 변환은
|
|
362
|
+
``hwpx.equation``을 알려 주는 ``MovedToSubmodule``을 냅니다.
|
|
298
363
|
"""
|
|
299
364
|
|
|
300
365
|
if name == "__version__":
|
|
@@ -306,8 +371,11 @@ def __getattr__(name: str) -> object:
|
|
|
306
371
|
raise AttributeError(
|
|
307
372
|
"hwpx lazy-export targets must remain inside the 'hwpx' package"
|
|
308
373
|
)
|
|
309
|
-
|
|
310
|
-
|
|
374
|
+
raise MovedToExperimental(_experimental_message(name))
|
|
375
|
+
|
|
376
|
+
module_name = _EQUATION_EXPORTS.get(name)
|
|
377
|
+
if module_name is not None:
|
|
378
|
+
raise MovedToSubmodule(_submodule_message(name, module_name))
|
|
311
379
|
|
|
312
380
|
module_name = _DEPRECATED_EXPORTS.get(name)
|
|
313
381
|
if module_name is not None:
|
|
@@ -333,9 +401,13 @@ def __getattr__(name: str) -> object:
|
|
|
333
401
|
if moved is not None:
|
|
334
402
|
statement = moved.import_statement(name)
|
|
335
403
|
assert statement is not None
|
|
404
|
+
if moved.moved_in != "5.0":
|
|
405
|
+
raise MovedToCompanion(
|
|
406
|
+
_moved_modules.moved_name_message(f"hwpx.{name}", statement)
|
|
407
|
+
)
|
|
336
408
|
raise MovedToCompanion(
|
|
337
409
|
f"{name}은(는) python-hwpx 5.0에서 companion 패키지로 이동했습니다.\n"
|
|
338
|
-
|
|
410
|
+
' pip install -U "python-hwpx-automation>=8"\n'
|
|
339
411
|
f" {statement}\n"
|
|
340
412
|
f'4.x를 계속 쓰려면: pip install "python-hwpx<5"\n'
|
|
341
413
|
f"전체 대체표: docs/migration-5.0.md"
|
|
@@ -358,7 +430,6 @@ def __dir__() -> list[str]:
|
|
|
358
430
|
set(globals())
|
|
359
431
|
| set(__all__)
|
|
360
432
|
| {"tools"}
|
|
361
|
-
| set(_EXPERIMENTAL_EXPORTS)
|
|
362
433
|
| set(_DEPRECATED_EXPORTS)
|
|
363
434
|
)
|
|
364
435
|
|
|
@@ -371,8 +442,8 @@ def __dir__() -> list[str]:
|
|
|
371
442
|
# ``from hwpx import *``에는 그대로 있습니다.
|
|
372
443
|
|
|
373
444
|
#: ``hwpx.tools``의 하위 모듈이 정의하고 ``hwpx.tools``가 다시 내보내는 stable 이름(텍스트 추출·개체
|
|
374
|
-
#: 찾기·문서
|
|
375
|
-
#:
|
|
445
|
+
#: 찾기·문서 비교·패키지 검증). 정적 import로 해석하므로 동적 import 지점은 늘지 않는다.
|
|
446
|
+
#: 메일 머지와 참조 일관성 검사는 7.0에서 python-hwpx-automation으로 옮겼다.
|
|
376
447
|
_TOOLS_STABLE_EXPORTS = frozenset(
|
|
377
448
|
{
|
|
378
449
|
"DEFAULT_NAMESPACES",
|
|
@@ -382,14 +453,8 @@ _TOOLS_STABLE_EXPORTS = frozenset(
|
|
|
382
453
|
"FoundElement",
|
|
383
454
|
"ObjectFinder",
|
|
384
455
|
"DOC_DIFF_REPORT_VERSION",
|
|
385
|
-
"REFERENCE_CONSISTENCY_REPORT_VERSION",
|
|
386
456
|
"diff_paragraphs",
|
|
387
457
|
"doc_diff",
|
|
388
|
-
"inspect_reference_consistency",
|
|
389
|
-
"MAIL_MERGE_REPORT_VERSION",
|
|
390
|
-
"inspect_mail_merge_placeholders",
|
|
391
|
-
"load_mail_merge_rows",
|
|
392
|
-
"merge_template_rows",
|
|
393
458
|
"EditorOpenSafetyReport",
|
|
394
459
|
"PackageValidationReport",
|
|
395
460
|
"validate_editor_open_safety",
|
|
@@ -401,16 +466,8 @@ _TOOLS_STABLE_EXPORTS = frozenset(
|
|
|
401
466
|
if TYPE_CHECKING: # type checkers see the real objects; at runtime they load lazily
|
|
402
467
|
from .tools.doc_diff import (
|
|
403
468
|
DOC_DIFF_REPORT_VERSION,
|
|
404
|
-
REFERENCE_CONSISTENCY_REPORT_VERSION,
|
|
405
469
|
diff_paragraphs,
|
|
406
470
|
doc_diff,
|
|
407
|
-
inspect_reference_consistency,
|
|
408
|
-
)
|
|
409
|
-
from .tools.mail_merge import (
|
|
410
|
-
MAIL_MERGE_REPORT_VERSION,
|
|
411
|
-
inspect_mail_merge_placeholders,
|
|
412
|
-
load_mail_merge_rows,
|
|
413
|
-
merge_template_rows,
|
|
414
471
|
)
|
|
415
472
|
from .tools.object_finder import FoundElement, ObjectFinder
|
|
416
473
|
from .tools.package_validator import (
|
|
@@ -436,7 +493,6 @@ _moved_modules.install(_MOVED_TO_COMPANION)
|
|
|
436
493
|
|
|
437
494
|
# --- stable 최상위 표면 (eager import) ------------------------------------------
|
|
438
495
|
# ``hwpx.tools``의 stable 이름은 위 ``_TOOLS_STABLE_EXPORTS``가 지연 해석한다.
|
|
439
|
-
from .ingest import HwpxMarkdownConverter
|
|
440
496
|
from .errors import Hwp5ConversionWarning, Hwp5Error, HwpxError
|
|
441
497
|
from .mutation_report import (
|
|
442
498
|
MutationReport,
|
|
@@ -458,15 +514,9 @@ from .quality import (
|
|
|
458
514
|
)
|
|
459
515
|
|
|
460
516
|
__all__ = [
|
|
461
|
-
"inspect_reference_consistency",
|
|
462
517
|
"doc_diff",
|
|
463
518
|
"diff_paragraphs",
|
|
464
|
-
"REFERENCE_CONSISTENCY_REPORT_VERSION",
|
|
465
519
|
"DOC_DIFF_REPORT_VERSION",
|
|
466
|
-
"merge_template_rows",
|
|
467
|
-
"load_mail_merge_rows",
|
|
468
|
-
"inspect_mail_merge_placeholders",
|
|
469
|
-
"MAIL_MERGE_REPORT_VERSION",
|
|
470
520
|
"QualityPolicy",
|
|
471
521
|
"SavePipeline",
|
|
472
522
|
"VisualCompleteReport",
|
|
@@ -487,7 +537,6 @@ __all__ = [
|
|
|
487
537
|
"SectionInfo",
|
|
488
538
|
"TextExtractor",
|
|
489
539
|
"FoundElement",
|
|
490
|
-
"HwpxMarkdownConverter",
|
|
491
540
|
"ObjectFinder",
|
|
492
541
|
"HwpxDocument",
|
|
493
542
|
"HwpxPackage",
|