Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX add more informative error in get_texture if inkscape is not installed #391

Merged
merged 1 commit into from
May 17, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions cortex/svgoverlay.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,15 @@ def get_texture(self, layer_name, height, name=None, background=None, labels=Tru
missing bits=32 keyword input argument, did not seeme necessary to specify
png bits.
"""
# Give a more informative error in case we don't have inkscape
# installed
if INKSCAPE_VERSION is None:
raise RuntimeError(
"Inkscape doesn't seem to be installed on this system."
"SVGOverlay.get_texture requires inkscape."
"Please make sure that inkscape is installed and that is "
"accessible from the terminal.")

import matplotlib.pyplot as plt
# Set the size of the texture
if background is not None:
Expand Down