Skip to content

Commit 8e30149

Browse files
17o2kvid
andcommitted
Apply suggestions from code review
Co-authored-by: kvid <kvid@users.noreply.github.com>
1 parent 684f6f0 commit 8e30149

File tree

5 files changed

+12
-9
lines changed

5 files changed

+12
-9
lines changed

docs/CHANGELOG.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
- Components that are not referenced in any connection set will not be rendered. Instead, a warning will be output in the console. ([#328](https://github.com/wireviz/WireViz/issues/328), [#332](https://github.com/wireviz/WireViz/pull/332))
88
- New command line interface ([#244](https://github.com/wireviz/WireViz/pull/244)). Run `wireviz --help` for details
99
- The path specified with the `-o`/`--output-dir` option no longer includes the filename (without extension) of the generated files. Use the `-O`/`--output-name` option to specify a different filename for the generated files.
10+
- The `.gv` file is no longer included as a default output format (only as an intermediate file during processing) unless specified with the new `-f` option described below.
1011

1112

1213
### New features
@@ -49,9 +50,7 @@
4950
- Remove HTML links from the input attributes ([#164](https://github.com/formatc1702/WireViz/pull/164))
5051
- Add harness metadata section ([#158](https://github.com/formatc1702/WireViz/issues/158), [#214](https://github.com/formatc1702/WireViz/pull/214))
5152
- Add support for supplier and supplier part number information ([#240](https://github.com/formatc1702/WireViz/issues/240), [#241](https://github.com/formatc1702/WireViz/pull/241/))
52-
- Add graph rendering options (colors, font, color name display style, ...) ([#158](https://github.com/formatc1702/WireViz/issues/158), [#214](https://github.com/formatc1702/WireViz/pull/214))
53-
- Add support for supplier and supplier part number information ([#240](https://github.com/formatc1702/WireViz/issues/240), [#241](https://github.com/formatc1702/WireViz/pull/241/))
54-
- Add graph rendering options (colors, font, color name display style, ...) ([#158](https://github.com/formatc1702/WireViz/issues/158), [#214](https://github.com/formatc1702/WireViz/pull/214))
53+
- Add graph rendering options (background colors, fontname, color name display style, ...) ([#158](https://github.com/formatc1702/WireViz/issues/158), [#214](https://github.com/formatc1702/WireViz/pull/214))
5554
- Add support for background colors for cables and connectors, as well as for some individual cells ([#210](https://github.com/formatc1702/WireViz/issues/210), [#219](https://github.com/formatc1702/WireViz/pull/219))
5655
- Add optional tweaking of the .gv output ([#215](https://github.com/formatc1702/WireViz/pull/215)) (experimental)
5756

docs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ mywire.bom.tsv BOM (bill of materials) as tab-separated text file
137137
mywire.html HTML page with wiring diagram and BOM embedded
138138
```
139139

140-
Wildcars in the file path are also supported to process multiple files at once, e.g.:
140+
Wildcards in the file path are also supported to process multiple files at once, e.g.:
141141
```
142142
$ wireviz ~/path/to/files/*.yml
143143
```

src/wireviz/DataClasses.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ def __post_init__(self) -> None:
216216
f'Unknown loop pin "{pin}" for connector "{self.name}"!'
217217
)
218218
# Make sure loop connected pins are not hidden.
219-
self.activate_pin(pin)
219+
self.activate_pin(pin, None)
220220

221221
for i, item in enumerate(self.additional_components):
222222
if isinstance(item, dict):
@@ -318,7 +318,7 @@ def __post_init__(self) -> None:
318318
f"Warning: Cable {self.name} length_unit={self.length_unit} is ignored because its length contains {u}"
319319
)
320320
self.length_unit = u
321-
elif not any(isinstance(self.length, t) for t in [int, float]):
321+
elif not isinstance(self.length, (int, float)):
322322
raise Exception(f"Cable {self.name} length has a non-numeric value")
323323
elif self.length_unit is None:
324324
self.length_unit = "m"

src/wireviz/wv_cli.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@
2828
epilog += ", ".join([f"{key} ({value.upper()})" for key, value in format_codes.items()])
2929

3030

31-
@click.command(epilog=epilog, no_args_is_help=True)
31+
@click.command(
32+
epilog=epilog,
33+
no_args_is_help=True,
34+
context_settings=dict(help_option_names=["-h", "--help"]),
35+
)
3236
@click.argument("file", nargs=-1)
3337
@click.option(
3438
"-f",

src/wireviz/wv_colors.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"BUVT", "VTBU", "OGVT", "VTOG", "GNVT", "VTGN", "BNVT", "VTBN", "SLVT", "VTSL",
2929
],
3030
"TELALT": [ # 25x2: Tip and then ring of each pair
31-
"WHBU", "BU", "WHOG", "OG", "WHGN", "GN", "WHBN", "BN", "WHSL", "SL",
31+
"WHBU", "BU", "WHOG", "OG", "WHGN", "GN", "WHBN", "BN", "WHSL", "SL",
3232
"RDBU", "BURD", "RDOG", "OGRD", "RDGN", "GNRD", "RDBN", "BNRD", "RDSL", "SLRD",
3333
"BKBU", "BUBK", "BKOG", "OGBK", "BKGN", "GNBK", "BKBN", "BNBK", "BKSL", "SLBK",
3434
"YEBU", "BUYE", "YEOG", "OGYE", "YEGN", "GNYE", "YEBN", "BNYE", "YESL", "SLYE",
@@ -156,7 +156,7 @@ def lookup(c: str) -> str:
156156
if len(output) == 2: # Give wires with EXACTLY 2 colors that striped look.
157157
output += output[:1]
158158
elif pad and len(output) == 1: # Hacky style fix: Give single color wires
159-
output *= 3 # a triple-up so that wires are the same size.
159+
output *= 3 # a triple-up so that wires are the same size
160160

161161
return output
162162

0 commit comments

Comments
 (0)