Browse Source

Renamed `Song.parse()` to `Song._parse()` (as this method is private)

pull/103/head
Louis 9 years ago
parent
commit
3a9f5aadce
  1. 4
      patacrep/songs/__init__.py
  2. 2
      patacrep/songs/chordpro/__init__.py

4
patacrep/songs/__init__.py

@ -128,7 +128,7 @@ class Song:
self.titles = [] self.titles = []
self.data = {} self.data = {}
self.cached = None self.cached = None
self.parse(config) self._parse(config)
# Post processing of data # Post processing of data
self.datadir = datadir self.datadir = datadir
@ -177,7 +177,7 @@ class Song:
return getattr(self, method)(output) return getattr(self, method)(output)
raise NotImplementedError() raise NotImplementedError()
def parse(self, config): # pylint: disable=no-self-use def _parse(self, config): # pylint: disable=no-self-use
"""Parse song. """Parse song.
It set the following attributes: It set the following attributes:

2
patacrep/songs/chordpro/__init__.py

@ -24,7 +24,7 @@ class ChordproSong(Song):
"""Get the template path for a given output_format.""" """Get the template path for a given output_format."""
return [os.path.join(path, output_format) for path in self.template_paths] return [os.path.join(path, output_format) for path in self.template_paths]
def parse(self, config): def _parse(self, config):
"""Parse content, and return the dictionary of song data.""" """Parse content, and return the dictionary of song data."""
with encoding.open_read(self.fullpath, encoding=self.encoding) as song: with encoding.open_read(self.fullpath, encoding=self.encoding) as song:
song = parse_song(song.read(), self.fullpath) song = parse_song(song.read(), self.fullpath)

Loading…
Cancel
Save