klayout-vector-file-export-cli 0.4__tar.gz → 0.5__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: klayout-vector-file-export-cli
3
- Version: 0.4
3
+ Version: 0.5
4
4
  Summary: Vector File Export CLI Tool for KLayout
5
5
  License: GPL-3.0-or-later
6
6
  License-File: LICENSE
@@ -258,7 +258,24 @@ class CLIWrapper:
258
258
  args = parser.parse_args(sys.argv[1:])
259
259
 
260
260
  settings = args_to_settings(args)
261
-
261
+
262
+ # Infer --format from --out suffix, or warn when they mismatch
263
+ if args.output_path is not None:
264
+ from vector_file_export_settings import VectorFileFormat
265
+ out_suffix = Path(args.output_path).suffix # e.g. '.pdf'
266
+ if args.file_format is None:
267
+ try:
268
+ settings.file_format = VectorFileFormat(out_suffix.lstrip('.'))
269
+ debug(f" ℹ Inferred --format={out_suffix.lstrip('.')} from output file suffix")
270
+ except ValueError:
271
+ pass # unknown suffix, will be caught by validation or use default
272
+ else:
273
+ expected_suffix = settings.file_format.suffix # e.g. '.pdf' (from @property)
274
+ if out_suffix.lower() != expected_suffix.lower():
275
+ print(f"WARNING: Output file suffix '{out_suffix}' does not match "
276
+ f"specified format '{settings.file_format.value}' "
277
+ f"(expected suffix '{expected_suffix}')")
278
+
262
279
  errors = []
263
280
 
264
281
  if args.input_path is None:
@@ -21,4 +21,4 @@
21
21
  # SPDX-License-Identifier: GPL-3.0-or-later
22
22
  # --------------------------------------------------------------------------------
23
23
  #
24
- __version__ = "0.4"
24
+ __version__ = "0.5"
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "klayout-vector-file-export-cli"
3
- version = "0.4"
3
+ version = "0.5"
4
4
  description = "Vector File Export CLI Tool for KLayout"
5
5
  authors = ["Martin Köhler <info@martinjankoehler.com>"]
6
6
  homepage = "https://github.com/iic-jku/klayout-vector-file-export-cli/"