|
@ -11,6 +11,7 @@ import jinja2 |
|
|
from patacrep import encoding, files, pkg_datapath |
|
|
from patacrep import encoding, files, pkg_datapath |
|
|
from patacrep.songs import Song |
|
|
from patacrep.songs import Song |
|
|
from patacrep.songs.chordpro.syntax import parse_song |
|
|
from patacrep.songs.chordpro.syntax import parse_song |
|
|
|
|
|
from patacrep.songs.errors import FileNotFound |
|
|
from patacrep.templates import Renderer |
|
|
from patacrep.templates import Renderer |
|
|
from patacrep.latex import lang2babel, UnknownLanguage |
|
|
from patacrep.latex import lang2babel, UnknownLanguage |
|
|
from patacrep.files import path2posix |
|
|
from patacrep.files import path2posix |
|
@ -113,20 +114,22 @@ class Chordpro2LatexSong(ChordproSong): |
|
|
try: |
|
|
try: |
|
|
return os.path.join("scores", super().search_partition(filename)) |
|
|
return os.path.join("scores", super().search_partition(filename)) |
|
|
except FileNotFoundError: |
|
|
except FileNotFoundError: |
|
|
LOGGER.warning( |
|
|
message = "Song '{}' (datadir '{}'): Score '{}' not found.".format( |
|
|
"Song '%s' (datadir '%s'): Score '%s' not found.", |
|
|
self.subpath, self.datadir, filename |
|
|
self.subpath, self.datadir, filename, |
|
|
|
|
|
) |
|
|
) |
|
|
|
|
|
self.errors.append(FileNotFound(self, filename)) |
|
|
|
|
|
LOGGER.warning(message) |
|
|
return None |
|
|
return None |
|
|
|
|
|
|
|
|
def search_image(self, filename): |
|
|
def search_image(self, filename): |
|
|
try: |
|
|
try: |
|
|
return os.path.join("img", super().search_image(filename)) |
|
|
return os.path.join("img", super().search_image(filename)) |
|
|
except FileNotFoundError: |
|
|
except FileNotFoundError: |
|
|
LOGGER.warning( |
|
|
message = "Song '{}' (datadir '{}'): Image '{}' not found.".format( |
|
|
"Song '%s' (datadir '%s'): Image '%s' not found.", |
|
|
self.subpath, self.datadir, filename |
|
|
self.subpath, self.datadir, filename, |
|
|
|
|
|
) |
|
|
) |
|
|
|
|
|
self.errors.append(FileNotFound(self, filename)) |
|
|
|
|
|
LOGGER.warning(message) |
|
|
return None |
|
|
return None |
|
|
|
|
|
|
|
|
def _jinja2_filters(self): |
|
|
def _jinja2_filters(self): |
|
|