Browse Source

`_render_size` is no longer a method of the abstract class

pull/218/head
Louis 8 years ago
parent
commit
5f05d8c217
  1. 17
      patacrep/songs/chordpro/__init__.py

17
patacrep/songs/chordpro/__init__.py

@ -60,7 +60,6 @@ class ChordproSong(Song):
'search_partition': self.search_partition,
'escape_specials': self._escape_specials,
'escape_url': self._escape_url,
'render_size': self._render_size,
})
return filters
@ -95,10 +94,6 @@ class ChordproSong(Song):
context.vars['content'] = content
return context.environment.get_template(content.template()).render(context)
@staticmethod
def _render_size(size):
raise NotImplementedError()
def _escape_specials(self, content, chars=None, *, translation_map=None):
if translation_map is None:
translation_map = self._translation_map
@ -129,10 +124,6 @@ class Chordpro2HtmlSong(ChordproSong):
)
return None
@staticmethod
def _render_size(size):
return "TODO"
class Chordpro2LatexSong(ChordproSong):
"""Render chordpro song to latex code"""
@ -191,6 +182,7 @@ class Chordpro2LatexSong(ChordproSong):
parent = super()._filters()
parent.update({
'lang2babel': self.lang2babel,
'render_size': self._render_size,
})
return parent
@ -242,6 +234,13 @@ class Chordpro2ChordproSong(ChordproSong):
'\\': '\\\\',
}
def _filters(self):
parent = super()._filters()
parent.update({
'render_size': self._render_size,
})
return parent
def search_file(self, filename, extensions=None, *, datadirs=None):
# pylint: disable=unused-variable
return filename

Loading…
Cancel
Save