Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] Title not updating on html output #360

Open
the-hess opened this issue May 22, 2024 · 3 comments · Fixed by #361
Open

[bug] Title not updating on html output #360

the-hess opened this issue May 22, 2024 · 3 comments · Fixed by #361
Labels
bug Something isn't working

Comments

@the-hess
Copy link

Trying a few things to get the title in the html output to update from the default "WireViz diagram and BOM".

I have the yaml file already saved in a directory, but the title isn't being taken from the file name. Adding

title: custom

doesn't seem to fix it either.

Commenting out the checks in wireviz.py to force it to use Path(yaml_file).stem just results in

TypeError: argument should be a str or an os.PathLike object where __fspath__ returns a str, not 'NoneType'
@kvid
Copy link
Collaborator

kvid commented May 22, 2024

@the-hess - Thank you for reporting this unexpected result, but please always provide all information about your set of versions as described in contributing guidelines and how you installed WireViz and dependencies. In your case, a YAML input example that triggers the unexpected output is also needed. Otherwise, it might be hard to help you when nobody knows how to recreate the error you report.

@the-hess
Copy link
Author

the-hess commented May 23, 2024

Apologies, I'm currently using version the 0.4 and have (manually) implemented the basic fixes in #346 and #347.

Graphviz version 9.0.0 (20230911.1827)
Python 3.12.2

yml:

options:
  mini_bom_mode: false

title: 07-0609

connectors:
  P1:
    type: XLR
    subtype: Male
    pincount: 4
    pinlabels: [GND, 24Vin, Signal, 24Vsafe]
    manufacturer: RS PRO
    mpn: 457-908
    image:
      src: resources/XLR.png
      width: 250

  S1:
    type: E-Stop
    subtype: Pushbutton
    show_pincount: false
    pins: [1,2,3,4]
    pinlabels: [11,21,12,22]
    pincount: 4
    manufacturer: ABB
    mpn: CEPY1-1002
    image: 
      src: resources/EStop.png
      width: 250

  B:
    style: simple
    type: Bootlace Ferrule
    color: VT
    manufacturer: RS PRO
    mpn: 157-1216

cables:
  W1:
    #category: bundle
    colors: [BK, RD, WH, GN]
    length: 1500
    length_unit: mm
    gauge: 18 AWG
    manufacturer: Belden
    mpn: 4302FE.00100
    additional_components:
      -  
        type: Clear Heatshrink
        subtype: 6mm diameter, 3:1 shrink ratio
        qty: 120
        unit: mm
        manufacturer: RS PRO
        mpn: 700-4456
      -
        type: Label
        subtype: White/Transparent
        manufacturer: Brady
        mpn: THT-64-427-3
        qty: 2
    notes:  |
      Affix part number at midpoint of cable using Brady label
      Affix "To S4" at endpoint of cable next to P1
      Secure each label with 60mm clear heatshrink

connections:
  -
    - P1: [1-4]
    - W1: [1-4]
    - B.
    - -->
    - S1: [1-4]

@kvid kvid added the bug Something isn't working label May 23, 2024
kvid added a commit that referenced this issue May 23, 2024
The CLI handling code was redesigned for v0.4 and it seems the code
to assigned a default title from v0.3.1 has been messed up. This bug
has not been triggered by build_examples.py due to it seems to call
the parse() function differently.

The output_name should be as default title when present.

This will fix the #360 bug report.
kvid added a commit that referenced this issue May 23, 2024
The CLI handling code was redesigned for v0.4 and it seems the code
to assigned a default title from v0.3.1 has been messed up. This bug
has not been triggered by build_examples.py due to it seems to call
the parse() function differently.

The output_name should be used as default title when present.

This will fix the #360 bug report.
kvid added a commit that referenced this issue May 23, 2024
The CLI handling code was redesigned for v0.4 and it seems the code
to assigned a default title from v0.3.1 has been messed up. This bug
has not been triggered by build_examples.py due to it seems to call
the parse() function differently.

The output_name should be used as default title when present.

This will fix the #360 bug report.
@kvid
Copy link
Collaborator

kvid commented May 23, 2024

@the-hess - Thank you for the information needed to investigate this.

  1. I can confirm there is an unfortunate title bug in v0.4 - please try my PR Use output_name as default title #361 and report your finding.
  2. Your attempt to override the title with title: 07-0609 in the YAML input failed because it needs to be within a top-level metadata section like this:
metadata:
  title: 07-0609

@kvid kvid linked a pull request May 23, 2024 that will close this issue
kvid added a commit that referenced this issue May 24, 2024
The CLI handling code was redesigned for v0.4 and it seems the code
to assign a default title from v0.3.1 has been messed up. This bug
has not been triggered by build_examples.py due to it seems to call
the parse() function differently.

The output_name should be used as default title when present.

This will fix the #360 bug report.
formatc1702 pushed a commit that referenced this issue Jun 7, 2024
The CLI handling code was redesigned for v0.4 and it seems the code
to assign a default title from v0.3.1 has been messed up. This bug
has not been triggered by build_examples.py due to it seems to call
the parse() function differently.

The output_name should be used as default title when present.

This will fix the #360 bug report.
kvid added a commit that referenced this issue Jun 7, 2024
The CLI handling code was redesigned for v0.4 and it seems the code
to assign a default title from v0.3.1 has been messed up. This bug
has not been triggered by build_examples.py due to it seems to call
the parse() function differently.

The output_name should be used as default title when present.

This will fix the #360 bug report.
kvid added a commit that referenced this issue Jun 7, 2024
The CLI handling code was redesigned for v0.4 and it seems the code
to assign a default title from v0.3.1 has been messed up. This bug
has not been triggered by build_examples.py due to it seems to call
the parse() function differently.

The output_name should be used as default title when present.

This will fix the #360 bug report.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants