Skip to content

Commit

Permalink
WireViz 0.4maybe: wireviz.parse()'s file_out argument optional again
Browse files Browse the repository at this point in the history
  • Loading branch information
amotl committed Oct 22, 2021
1 parent 9149ce2 commit 75dfba9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def test_html(self, client):
assert response.headers["Content-Disposition"] == "attachment; filename=test.html"
assert b"<!DOCTYPE html>" in response.data
assert b"""<meta name="generator" content="WireViz""" in response.data
assert b"<title>wiring-42</title>" in response.data
assert b"<title>WireViz diagram and BOM</title>" in response.data
assert b"<h2>Diagram</h2>" in response.data
assert b"<svg" in response.data
assert b"<h2>Bill of Materials</h2>" in response.data
Expand Down
6 changes: 1 addition & 5 deletions wireviz_web/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,7 @@ def wireviz_render(input_yaml: str, output_mimetype: str, output_filename: str)

# Parse WireViz YAML.
try:
# WireViz >= 0.3 needs the `file_out` parameter.
# This will apparently be deleted by WireViz?
with TemporaryDirectory() as tmpdir:
file_out = Path(tmpdir) / "wiring-42"
harness: Harness = wireviz.parse(yaml_input=input_yaml, file_out=file_out, return_types="harness")
harness: Harness = wireviz.parse(yaml_input=input_yaml, return_types="harness")
except Exception as ex:
message = f"Unable to parse WireViz YAML format: {ex}"
logger.exception(message)
Expand Down

0 comments on commit 75dfba9

Please sign in to comment.