Commit 188d2105 authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz

python: suggest installing GraphViz when dot is not found

This fixes an issue mentioned in #375.

* python/spot/aux.py (str_to_svg): Catch a missing 'dot' and instruct
the user to install GraphViz.
* THANKS: Add reporter.
parent 573c593f
Pipeline #5886 passed with stage
in 150 minutes and 26 seconds
......@@ -24,6 +24,7 @@ Jean-Michel Couvreur
Jean-Michel Ilié
Jeroen Meijer
Joachim Klein
Juan Tzintzun
Juraj Major
Kristin Y. Rozier
Martin Dieguez Lodeiro
......
# -*- coding: utf-8 -*-
# Copyright (C) 2016 Laboratoire de Recherche et Développement de l'Epita
# Copyright (C) 2016, 2019 Laboratoire de Recherche et Développement de l'Epita
# (LRDE).
#
# This file is part of Spot, a model checking library.
......@@ -51,10 +51,17 @@ def str_to_svg(str):
"""
Send some text to dot for conversion to SVG.
"""
dot = subprocess.Popen(['dot', '-Tsvg'],
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
try:
dot = subprocess.Popen(['dot', '-Tsvg'],
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
except FileNotFoundError:
print("The command 'dot' seems to be missing on your system.\n"
"Please install the GraphViz package "
"and make sure 'dot' is in your PATH.", file=sys.stderr)
raise
stdout, stderr = dot.communicate(str)
if stderr:
print("Calling 'dot' for the conversion to SVG produced the message:\n"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment