Browse Source

Pylint

pull/103/head
Louis 9 years ago
parent
commit
8e480a3342
  1. 14
      patacrep/songs/chordpro/__init__.py
  2. 2
      patacrep/songs/latex/__init__.py

14
patacrep/songs/chordpro/__init__.py

@ -17,9 +17,19 @@ class ChordproSong(Song):
@staticmethod @staticmethod
def iter_template_paths(templatedirs, output_format): def iter_template_paths(templatedirs, output_format):
"""Iterate over paths in which templates are to be searched.
:param iterator templatedirs: Iterators of additional directories (the
default hard-coded template directory is returned last).
:param str output_format: Song output format, which is appended to
each directory.
"""
for directory in templatedirs: for directory in templatedirs:
yield os.path.join(directory, output_format) yield os.path.join(directory, output_format)
yield os.path.join(os.path.abspath(pkg_resources.resource_filename(__name__, 'data')), output_format) yield os.path.join(
os.path.abspath(pkg_resources.resource_filename(__name__, 'data')),
output_format,
)
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."""
@ -33,7 +43,7 @@ class ChordproSong(Song):
'song': song, 'song': song,
} }
def render(self, output_format, output=None, template="song", templatedirs=None): def render(self, output_format, output=None, template="song", templatedirs=None): # pylint: disable=arguments-differ
if templatedirs is None: if templatedirs is None:
templatedirs = [] templatedirs = []

2
patacrep/songs/latex/__init__.py

@ -14,7 +14,7 @@ from patacrep.songs import Song
class LatexSong(Song): class LatexSong(Song):
"""LaTeX song parser.""" """LaTeX song parser."""
def parse(self, __config): def _parse(self, __config):
"""Parse content, and return the dictinory of song data.""" """Parse content, and return the dictinory 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:
self.data = parse_song(song.read(), self.fullpath) self.data = parse_song(song.read(), self.fullpath)

Loading…
Cancel
Save