From 960a3693d35c477e53e42ceb9a0768653c7e5270 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20Mart=C3=ADnez=20Portela?= Date: Tue, 13 Jun 2023 00:00:35 +0200 Subject: [PATCH] Fix typo on intermediate dot file name. --- scripts/gen_centered_graph.py | 8 +++----- scripts/generate.py | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/scripts/gen_centered_graph.py b/scripts/gen_centered_graph.py index fce246e..f39b755 100644 --- a/scripts/gen_centered_graph.py +++ b/scripts/gen_centered_graph.py @@ -1,12 +1,10 @@ -import requests -import sys import subprocess import ops_cache import copy import tempfile +import os # TODO: Properly render outgouing links - @ops_cache.cache def gen(headline_id, graph): reference_node = headline_id @@ -117,9 +115,9 @@ def gen(headline_id, graph): print("_" + k.replace("-", "_") + "->" + t, file=f) f.write('}\n') - f.close() + f.flush() with tempfile.NamedTemporaryFile(suffix='.svg') as fsvg: - subprocess.call("fdp graph.dot -Tsvg -o '{}'".format(fsvg.name), shell=True) + subprocess.call(['fdp', f.name, '-Tsvg', '-o', fsvg.name]) fsvg.seek(0) return fsvg.read().decode() diff --git a/scripts/generate.py b/scripts/generate.py index c6ecc3d..cff7b37 100644 --- a/scripts/generate.py +++ b/scripts/generate.py @@ -725,7 +725,7 @@ def render(headline, doc, graph, headlineLevel): content = [] render_tree(dom, content, headline, graph) - if headline.id: + if headline.id and headlineLevel == 0: render_connections(headline.id, content, graph) for child in headline.children: