Using Any or str in type annotations might increase the need for extra
comments to explain the real valid values. However, such needs can be
drastically reduced with the help of semanticly named type aliases.
Each type alias have their legal values described in comments.
Actual validation might be implemented in the future.
GraphViz does not support the a HTML tag when generating the tables for the
cables/connectors, so this change will remove these tags for the graph generation.
However for the HTML BOM output table these links will be generated.
The https://validator.w3.org/ reported Errors:
The align attribute on the th/td element is obsolete. Use CSS instead.
By replacing align="X" attributes with text-align:X; CSS equivalent,
the validator now completes without any errors or warnings.
This solves the remaining issues from #97.
The application name and URL was defined several places in the code,
and the name was not written exactly the same everywhere.
By using the same constants everywhere, consistency is obtained.
This image, with an optional caption below, is displayed in the lower
section of the connector/cable node in the diagram - just above the
notes if present.
This solves the basic part of issue #27, and is a continuation of
PR #137 that was closed due to changes in the base branch.
Add -V command line option (and --version as an alias) to
both wireviz.py and build_examples.py that show version number.
Move the version number from setup.py into __init__.py to access
the same version number specification from all files needing it.
This solves part 4 of issue #167.
It seems, that the current implementation ignores --generate-bom,
and that parser.add_argument() code line is therefore commented
out until it gets implemented to avoid any confusion.
This solves part 1 of issue #167.
When used to "git diff", it is easy to write "build_examples.py diff"
instead of "build_examples.py compare" by a mistake. Therefore,
"diff" is now an alias to "compare" so both commands will work.
This solves part 3 of issue #167.
Adding an optional -b BRANCH argument to build_examples.py to enable
comparing to and restoring from any branch or commit. That will help
when e.g. reversing an unfortunate commit of generated files.
This solves part 2 of issue #167.
- Add double quotes around path string in `os.system()` call and
status output to handle any spaces in the path.
- Split the `generated_extensions` list into the two lists
`extensions_not_containing_graphviz_output` and
`extensions_containing_graphviz_output` for readability.
By putting all value entries on separate lines with a trailing comma,
it becomes easier to read the diff when later inserting or deleting
the first or last value entry in any dict.
This make it possible to append '-g' or '--groups' followed by
space separated group names to any CLI action command, and the
set of generated files affected by the command will be limited
to the selected groups ('examples', 'tutorial', and 'demos').
Default is all groups. A simple help text is added for each of
the arguments (action and groups) to improve the autogenerated
CLI help output.
This is a squash rebase of these commits:
- p ec29076 Make all actions honor the optional argument -generate
- s e3ad11a Move open_file_append() outside the if to avoid re-open
- s ba4b900 Avoid including readme in all file groups
- s 1ca8bd1 Simplify code
- s a9e7337 Rename some variables to better reflect their contents and relations
- s 58a54b2 Move test to include readme inside collect_filenames() function
- s f2a0db0 Improve status output by adding group name
- s d3b299b Rename -generate option to -g/--groups and add argument help
Add new actions:
- 'compare' action to compare generated files (except those
generated by Graphviz) against the latest commit, and
- 'restore' action to restore generated files from the latest commit.
This is a squash rebase of these commits:
- p 9ad3e13 Reduce code duplication by moving common code into a generic function
- s d4feae6 Add action to restore generated files from git repository
- s 64f6507 Add action to compare generated files against git repository
- s 099c202 Simplify code
- Use `pathlib.Path` instead of `os.path`
- Fix order of files while building
- Consolidate code for building demos, examples and tutorial
- Change argument from `tutorials` to `tutorial` to remain consistent
- Add some indentation in console output for better readability
As the spline shield wires were rendered as tinned wires with
black borders, and the shield wires in cable nodes were rendered
as a single (bottom) border, they didn't fit well together.
Each shield wire is now rendered equally along the spline sections
and in cable nodes. If cable.shield is true, they are rendered as
thin black wires in the same way as before multi-colors were
introduced. The new feature is that cable.shield is allowed to
contain a two-letter color code to specify a colored shield wire
with black borders.
The shield wire thickness is not increased, even if the cable has
some multi-colored wires that makes all other wires to increase.
This fixes bug #125.
- Shorten `part_number` to `pn`
- Shorten `manufacturer_part_number` to `mpn`
- Show `manufacturer` and `mpn` in a single cell of the node
- Replace `manufacturer` with `'MPN'`within the node if no manufacturer is specified.
- Rearrange order of P/N fields within node
`{pn} | {manufacturer}: {mpn}`