Render SVG in public/ subdir

This commit is contained in:
Jack Grigg 2021-05-07 12:04:45 +12:00
parent 0fc4887bf3
commit 4690a7220a
2 changed files with 5 additions and 1 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
__pycache__
public

View File

@ -8,6 +8,7 @@ import drest
import networkx as nx import networkx as nx
import mimetypes import mimetypes
import os
from textwrap import wrap from textwrap import wrap
from urllib.parse import urlparse from urllib.parse import urlparse
@ -211,7 +212,8 @@ def main():
# Draw the result! # Draw the result!
ag.graph_attr['rankdir'] = 'LR' ag.graph_attr['rankdir'] = 'LR'
ag.layout(prog='dot') 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__': if __name__ == '__main__':