diff --git a/src/wireviz/Harness.py b/src/wireviz/Harness.py index 44d6947..1791ea4 100644 --- a/src/wireviz/Harness.py +++ b/src/wireviz/Harness.py @@ -18,7 +18,7 @@ from wireviz.wv_bom import manufacturer_info_field, component_table_entry, \ from wireviz.wv_html import generate_html_output from wireviz.wv_helper import awg_equiv, mm2_equiv, tuplelist2tsv, flatten2d, \ open_file_read, open_file_write -from wireviz.svgembed import embed_svg_images_file +from wireviz.svgembed import embed_svg_images, embed_svg_images_file class Harness: @@ -343,12 +343,8 @@ class Harness: @property def svg(self): - from io import BytesIO graph = self.create_graph() - data = BytesIO() - data.write(graph.pipe(format='svg')) # TODO: use embed_svg_images() - data.seek(0) - return data.read() + return embed_svg_images(graph.pipe(format='svg').decode('utf-8'), Path.cwd()) def output(self, filename: (str, Path), view: bool = False, cleanup: bool = True, fmt: tuple = ('pdf', )) -> None: # graphical output