licos-dev-cli 0.4.2__py3-none-any.whl → 0.4.4__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.
- licos_dev_cli/docx_commands.py +43 -9
- licos_dev_cli/main.py +1 -0
- {licos_dev_cli-0.4.2.dist-info → licos_dev_cli-0.4.4.dist-info}/METADATA +2 -2
- licos_dev_cli-0.4.4.dist-info/RECORD +10 -0
- licos_dev_cli-0.4.2.dist-info/RECORD +0 -10
- {licos_dev_cli-0.4.2.dist-info → licos_dev_cli-0.4.4.dist-info}/WHEEL +0 -0
- {licos_dev_cli-0.4.2.dist-info → licos_dev_cli-0.4.4.dist-info}/entry_points.txt +0 -0
licos_dev_cli/docx_commands.py
CHANGED
|
@@ -55,7 +55,7 @@ def text_input(value, path, name):
|
|
|
55
55
|
|
|
56
56
|
@click.command("docx-structure")
|
|
57
57
|
@click.option("--file", "source", required=True, type=click.Path(exists=True, dir_okay=False))
|
|
58
|
-
@click.option("--scope", type=click.Choice(["blocks", "paragraphs"]), default="blocks", show_default=True)
|
|
58
|
+
@click.option("--scope", type=click.Choice(["blocks", "paragraphs", "tables"]), default="blocks", show_default=True)
|
|
59
59
|
@click.option("--offset", type=click.IntRange(min=1), default=1, show_default=True)
|
|
60
60
|
@click.option("--limit", type=click.IntRange(1, 200), default=20, show_default=True)
|
|
61
61
|
@click.option("--max-chars", type=click.IntRange(1, 8000), default=200, show_default=True)
|
|
@@ -70,6 +70,21 @@ def docx_structure(**arguments):
|
|
|
70
70
|
result(read_docx_structure(**arguments))
|
|
71
71
|
|
|
72
72
|
|
|
73
|
+
@click.command("docx-inspect")
|
|
74
|
+
@click.option("--file", "source", required=True, type=click.Path(exists=True, dir_okay=False))
|
|
75
|
+
@click.option("--scope", type=click.Choice(["all", "fields", "images", "tables"]), default="all", show_default=True)
|
|
76
|
+
@click.option("--offset", type=click.IntRange(min=1), default=1, show_default=True)
|
|
77
|
+
@click.option("--limit", type=click.IntRange(1, 200), default=20, show_default=True)
|
|
78
|
+
@sdk_errors
|
|
79
|
+
def docx_inspect(**arguments):
|
|
80
|
+
"""Inspect native TOC fields, embedded/linked images and tables, including headers/footers.
|
|
81
|
+
|
|
82
|
+
Reports field update settings, not rendered pages. Continue each scope with next_offset.
|
|
83
|
+
"""
|
|
84
|
+
from licos_dev_sdk import inspect_docx
|
|
85
|
+
result(inspect_docx(**arguments))
|
|
86
|
+
|
|
87
|
+
|
|
73
88
|
@click.command("docx-target")
|
|
74
89
|
@click.option("--file", "source", required=True, type=click.Path(exists=True, dir_okay=False))
|
|
75
90
|
@target_options
|
|
@@ -141,7 +156,8 @@ def docx_table_set(text, text_file, **arguments):
|
|
|
141
156
|
@click.command("docx-table-insert-rows")
|
|
142
157
|
@edit_options
|
|
143
158
|
@click.option("--table", required=True, type=click.IntRange(min=1))
|
|
144
|
-
@click.option("--before",
|
|
159
|
+
@click.option("--before", type=click.IntRange(min=1), help="Insert before this one-based row. Choose --before or --append.")
|
|
160
|
+
@click.option("--append", is_flag=True, help="Append after the last row; no row count calculation needed.")
|
|
145
161
|
@click.option("--template-row", required=True, type=click.IntRange(min=1), help="Existing styled row; must not intersect a vertical merge.")
|
|
146
162
|
@click.option("--input", "input_path", required=True, type=click.Path(exists=True, dir_okay=False), help="Two-dimensional JSON array of scalar values. Fill a merged cell once; count is inferred.")
|
|
147
163
|
@sdk_errors
|
|
@@ -153,17 +169,35 @@ def docx_table_insert_rows(input_path, **arguments):
|
|
|
153
169
|
|
|
154
170
|
@click.command("docx-verify")
|
|
155
171
|
@click.option("--file", "source", required=True, type=click.Path(exists=True, dir_okay=False))
|
|
156
|
-
@click.option("--
|
|
172
|
+
@click.option("--original", type=click.Path(exists=True, dir_okay=False), help="Compare non-body package parts (headers, footers, styles, images) and section settings with the original.")
|
|
173
|
+
@click.option("--input", "input_path", type=click.Path(exists=True, dir_okay=False), help="JSON array: target, exactly one of text/text_file, optional mode. Relative text_file paths use the JSON file's directory.")
|
|
174
|
+
@target_options
|
|
175
|
+
@click.option("--text", default=None, help="Expected text at one target; use this or --text-file instead of --input.")
|
|
176
|
+
@click.option("--text-file", type=click.Path(exists=True, dir_okay=False), help="UTF-8 expected text; preserves whitespace and line breaks.")
|
|
177
|
+
@click.option("--mode", type=click.Choice(["equals", "contains", "absent"]), help="Single-target comparison; defaults to equals.")
|
|
157
178
|
@sdk_errors
|
|
158
|
-
def docx_verify(source, input_path):
|
|
159
|
-
"""Verify exact positions
|
|
179
|
+
def docx_verify(source, original, input_path, paragraph, block, table, row, column, text, text_file, mode):
|
|
180
|
+
"""Verify exact positions and optional original parts. No assertions means no content verification.
|
|
160
181
|
|
|
161
|
-
Example: [{"target":{"
|
|
182
|
+
Example: [{"target":{"block":3},"text_file":"expected.txt","mode":"equals"}]
|
|
162
183
|
|
|
163
|
-
Exits 2 if an assertion fails. Does not certify rendered page layout.
|
|
184
|
+
Exits 2 if an assertion or original comparison fails. Does not certify rendered page layout.
|
|
164
185
|
"""
|
|
165
186
|
from licos_dev_sdk import verify_docx
|
|
166
|
-
|
|
187
|
+
position = target(paragraph, block, table, row, column)
|
|
188
|
+
single = bool(position) or text is not None or text_file is not None or mode is not None
|
|
189
|
+
if input_path is not None and single:
|
|
190
|
+
raise click.UsageError("use --input or a single target with --text/--text-file, not both")
|
|
191
|
+
expectations = json.loads(Path(input_path).read_text(encoding="utf-8")) if input_path else None
|
|
192
|
+
if single:
|
|
193
|
+
expectation = {"target": position, "mode": mode or "equals"}
|
|
194
|
+
if text is not None:
|
|
195
|
+
expectation["text"] = text
|
|
196
|
+
if text_file is not None:
|
|
197
|
+
expectation["text_file"] = text_file
|
|
198
|
+
expectations = [expectation]
|
|
199
|
+
report = verify_docx(source, original=original, expectations=expectations,
|
|
200
|
+
base_dir=Path(input_path).resolve().parent if input_path else Path.cwd())
|
|
167
201
|
result(report)
|
|
168
202
|
if not report["verified"]:
|
|
169
203
|
raise click.exceptions.Exit(2)
|
|
@@ -171,4 +205,4 @@ def docx_verify(source, input_path):
|
|
|
171
205
|
|
|
172
206
|
DOCX_COMMANDS = [docx, docx_template, docx_edit, docx_read, docx_structure, docx_target,
|
|
173
207
|
docx_replace, docx_delete_blocks, docx_edit_structure, docx_table_set,
|
|
174
|
-
docx_table_insert_rows, docx_verify]
|
|
208
|
+
docx_table_insert_rows, docx_verify, docx_inspect]
|
licos_dev_cli/main.py
CHANGED
|
@@ -14,6 +14,7 @@ from .common import _read_input, _read_json, _json_option, _echo_json, _path_to_
|
|
|
14
14
|
# ── CLI Group ────────────────────────────────────────────────────────────────
|
|
15
15
|
|
|
16
16
|
@click.group()
|
|
17
|
+
@click.version_option(package_name="licos-dev-cli")
|
|
17
18
|
def cli():
|
|
18
19
|
"""LICOS Dev - file generation and model CLI for AI agents."""
|
|
19
20
|
pass
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: licos-dev-cli
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.4
|
|
4
4
|
Summary: LICOS Dev CLI - generate files and call model capabilities
|
|
5
5
|
Requires-Python: >=3.10
|
|
6
6
|
Requires-Dist: click>=8.1
|
|
7
|
-
Requires-Dist: licos-dev-sdk>=0.4.
|
|
7
|
+
Requires-Dist: licos-dev-sdk>=0.4.4
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
licos_dev_cli/__init__.py,sha256=3ppe0RjcWaGGBFyrVGRBMMxJ9JsQ5kGVJQNHnVTiwxE,21
|
|
2
|
+
licos_dev_cli/common.py,sha256=F-QpbA1mgOpUxF6r5WX1081Shv4qT2vXsqQiiHL9QsA,2474
|
|
3
|
+
licos_dev_cli/docx_commands.py,sha256=LBV6sRmRX3RO_IvmdoGnA9vsxirfhMwvbED7Bl9FQP0,10284
|
|
4
|
+
licos_dev_cli/docx_legacy.py,sha256=khbJenMhTAqHqcZvtXLMe2mexEdv_hiO_2B_z4XUEjs,4540
|
|
5
|
+
licos_dev_cli/main.py,sha256=BSWyY5FMfRRA2hDDme-D_3vnJGgPgGYe8-fPlvTRpSY,37598
|
|
6
|
+
licos_dev_cli/ppt_master.py,sha256=CA5W-xvMWV-CAPOnkkXQmsHNm8gRCx2A2ZN4kYNU-dI,24027
|
|
7
|
+
licos_dev_cli-0.4.4.dist-info/METADATA,sha256=oZYgaYcHpDk5os_CnEb5T4MKpgBg92mBvQ41jO4HeTU,211
|
|
8
|
+
licos_dev_cli-0.4.4.dist-info/WHEEL,sha256=mffPy8wBnZQn2VnJUU5jE99KsxaSfiyMHV9Yt0aLVxs,87
|
|
9
|
+
licos_dev_cli-0.4.4.dist-info/entry_points.txt,sha256=DGWCJa7PKnDzqBZ4RHPogHg5tTBM2C6QfWiYHDohN3s,53
|
|
10
|
+
licos_dev_cli-0.4.4.dist-info/RECORD,,
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
licos_dev_cli/__init__.py,sha256=3ppe0RjcWaGGBFyrVGRBMMxJ9JsQ5kGVJQNHnVTiwxE,21
|
|
2
|
-
licos_dev_cli/common.py,sha256=F-QpbA1mgOpUxF6r5WX1081Shv4qT2vXsqQiiHL9QsA,2474
|
|
3
|
-
licos_dev_cli/docx_commands.py,sha256=AcfkxZtf_N-dBB7MqBFXHXNVrSr403JLi6XYu8NYNbs,7957
|
|
4
|
-
licos_dev_cli/docx_legacy.py,sha256=khbJenMhTAqHqcZvtXLMe2mexEdv_hiO_2B_z4XUEjs,4540
|
|
5
|
-
licos_dev_cli/main.py,sha256=GdK4Q5K41zHuut-B6QS_GE19TLXLindA3OluWOBangM,37546
|
|
6
|
-
licos_dev_cli/ppt_master.py,sha256=CA5W-xvMWV-CAPOnkkXQmsHNm8gRCx2A2ZN4kYNU-dI,24027
|
|
7
|
-
licos_dev_cli-0.4.2.dist-info/METADATA,sha256=EDP_V77-rzl61PK85iSwgEBMa65XWJKE0qJrOYne4rw,211
|
|
8
|
-
licos_dev_cli-0.4.2.dist-info/WHEEL,sha256=mffPy8wBnZQn2VnJUU5jE99KsxaSfiyMHV9Yt0aLVxs,87
|
|
9
|
-
licos_dev_cli-0.4.2.dist-info/entry_points.txt,sha256=DGWCJa7PKnDzqBZ4RHPogHg5tTBM2C6QfWiYHDohN3s,53
|
|
10
|
-
licos_dev_cli-0.4.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|