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

Loading…
Cancel
Save