-
Notifications
You must be signed in to change notification settings - Fork 229
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
[feature] Only output the files that user requests #60
Comments
I had looked into this before, and there are a couple of different ways this can be done, from refactoring the outputs to simple if-else statements. The Graphviz DOT file can be useful as it can be converted into something like a Visio document, but (and I have to check the code,) I think its generated due to how Graphviz processes the DOT file to generate conversions. Since it externally calls the dot executable, and the dot executable needs to read from disk (at least by default), I think we would have to just delete the file if the user does not request it, unless Graphviz and the python library for it support sending the info via named pipes. |
Right now the .gv file is explicitly saved so that's easy to fix. I'd say a couple of |
If you are looking for a great library, check out click. Pure python and easy to maintain. No chained |
That looks quite interesting. @slightlynybbled would you be interested in taking over this issue and rewriting the current CLI handling? Currently, the The usecases I envision: *[Note] prepending a file is already implemented, though poorly tested (by me, at least). It is a really useful option since YAML does not support including files by default. The idea is that one could curate a library of commonly used connectors and cables: # this is library.yml
molex_kk254_female_4pin_from_library:
type: KK 254
subtype: female
pincount: 4
pn: xxx
mpn: yyy
manufacturer: Molex and then include them in # this is inputfile.yml
connectors:
X1:
<<: *molex_kk254_female_4pin_from_library # this will work since the --prepend'ed file will be appended before it goes through WireViz's YAML parser
pinlabels: [GND, VCC, SCL, SDA]
notes: Just edit any attributes that are not specified in the library, or need overriding |
I suggest an |
It would also be great if the YAML had the ability to specify the requested outputs. |
I agree, but I would like to be able to override such YAML specifiers with the CLI, and in that case we would need to define how to handle conflicts: Should any CLI specifier presence make all YAML specifiers to be ignored, or should it happen specifier by specifier instead? In the latter case, negative specifiers (e.g. removing 'csv' if that was specified by the YAML specifiers) might be needed. |
Currently, running WireViz generates multiple output files from the YAML input by default:
.png
raster image.svg
vector image.gv
GraphViz code.tsv
BOM.html
page with embedded diagram and BOM (feature to be expanded, see # 32)Especially the GraphViz code is probably not of much interest to the end user. The
output()
function in Harness.py should be updated to only actually generate the files the user needs.A good default behavior should be set, ideally just with one file type to avoid cluttering the file system.
The text was updated successfully, but these errors were encountered: