From 4690a7220adc73437388d50785a1954cdcc7b937 Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Fri, 7 May 2021 12:04:45 +1200 Subject: [PATCH] Render SVG in public/ subdir --- .gitignore | 2 ++ zcash-core-graph.py | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..8aca0e05 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +__pycache__ +public diff --git a/zcash-core-graph.py b/zcash-core-graph.py index 74a9b3f7..bfb9e394 100755 --- a/zcash-core-graph.py +++ b/zcash-core-graph.py @@ -8,6 +8,7 @@ import drest import networkx as nx import mimetypes +import os from textwrap import wrap from urllib.parse import urlparse @@ -211,7 +212,8 @@ def main(): # Draw the result! ag.graph_attr['rankdir'] = 'LR' ag.layout(prog='dot') - ag.draw('zcash-core-dag.svg') + os.makedirs('public', exist_ok=True) + ag.draw('public/zcash-core-dag.svg') if __name__ == '__main__':