Browse Source

Add a default return when search_image fails (breaks some tests)

pull/98/head
Oliverpool 9 years ago
parent
commit
220d7c6001
  1. 4
      patacrep/songs/__init__.py

4
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

Loading…
Cancel
Save