Open Monniasza opened 4 days ago
@Monniasza wrote:
I'm unable to process my WireViz file. It's correctly formatted,
I'm afraid, your YAML input is not completely correct.
but it fails with a strange error. To reproduce, save the harness.yaml file in the same directory that command will be run from, and then run
wireviz harness.yaml
oskar@oskar-Inspiron-5577:~/SynologyDrive/3D/filamaker$ wireviz harness.yaml WireViz 0.4.1 Input file: harness.yaml Output file: harness.[html|png|svg|tsv] Traceback (most recent call last): [...] File "/home/oskar/.local/share/pipx/venvs/wireviz/lib/python3.12/site-packages/wireviz/wireviz.py", line 140, in parse image = attribs.get("image") ^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'get'
This exception tells me that one of your entries where an image
attribute is allowed (connector or cable entry) is None
instead of the expected dict
type.
I admit that we should improve the explanation of such unexpected YAML input, and we discuss such improvements in #207.
And here's the harness.yaml file:
templates: - [...] connectors: BoardMains: type: Molex KK 254 subtype: female pinlabels: [L, N, PE] BoardMains2: BoardPower: [...]
Your BoardMains2
entry has no attributes and is therefore interpreted as None
. If I add a pincount: 3
attribute to this entry, the YAML input is processed without any error.
connections: - - ToPSU: [1-3] - CableMainsIn: [1-3] - BoardMains: [1-3] - - BoardMains2: [1-3]
The BoardMains2
needs at least 3 pins for this connection to be legal.
@kvid The message should say that entry is empty, like "SomeConnector is empty"
I'm unable to process my WireViz file. It's correctly formatted, but it fails with a strange error. To reproduce, save the harness.yaml file in the same directory that command will be run from, and then run
wireviz harness.yaml
And here's the harness.yaml file: