From 220d7c6001aeda4e69cbad78afa1332c5500e841 Mon Sep 17 00:00:00 2001 From: Oliverpool Date: Thu, 17 Sep 2015 16:31:11 +0200 Subject: [PATCH] Add a default return when search_image fails (breaks some tests) --- patacrep/songs/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/patacrep/songs/__init__.py b/patacrep/songs/__init__.py index 262187c4..b62d45ba 100644 --- a/patacrep/songs/__init__.py +++ b/patacrep/songs/__init__.py @@ -222,7 +222,7 @@ def unprefixed_title(title, prefixes): return match.group(2) return title -def search_image(image, chordprofile, config): +def search_image(image, chordprofile, config, default=None): """Return the file name of an image, so that LaTeX will find it. :param str image: The name, as provided in the chordpro file. @@ -256,4 +256,4 @@ def search_image(image, chordprofile, config): return os.path.join(directory, 'img', image) # Could not find image - return image + return default