Browse Source

pylint

pull/76/head
Louis 10 years ago
parent
commit
e3f523c297
  1. 1
      patacrep/content/section.py
  2. 7
      patacrep/content/song.py
  3. 1
      patacrep/content/songsection.py
  4. 1
      patacrep/files.py
  5. 2
      patacrep/templates.py

1
patacrep/content/section.py

@ -15,6 +15,7 @@ FULL_KEYWORDS = KEYWORDS + ["{}*".format(word) for word in KEYWORDS]
class Section(Content): class Section(Content):
"""A LaTeX section.""" """A LaTeX section."""
# pylint: disable=too-few-public-methods
def __init__(self, keyword, name, short=None): def __init__(self, keyword, name, short=None):
self.keyword = keyword self.keyword = keyword

7
patacrep/content/song.py

@ -67,12 +67,13 @@ def parse(keyword, argument, contentlist, config):
LOGGER.debug('Parsing file "{}"'.format(filename)) LOGGER.debug('Parsing file "{}"'.format(filename))
extension = filename.split(".")[-1] extension = filename.split(".")[-1]
if extension not in plugins: if extension not in plugins:
LOGGER.warning( LOGGER.warning((
'I do not know how to parse "{}": name does not end with one of {}. Ignored.' 'I do not know how to parse "{}": name does '
'not end with one of {}. Ignored.'
).format( ).format(
os.path.join(songdir.datadir, filename), os.path.join(songdir.datadir, filename),
", ".join(["'.{}'".format(key) for key in plugins.keys()]), ", ".join(["'.{}'".format(key) for key in plugins.keys()]),
) ))
continue continue
renderer = SongRenderer(plugins[extension]( renderer = SongRenderer(plugins[extension](
songdir.datadir, songdir.datadir,

1
patacrep/content/songsection.py

@ -9,6 +9,7 @@ KEYWORDS = [
class SongSection(Content): class SongSection(Content):
"""A songsection or songchapter.""" """A songsection or songchapter."""
# pylint: disable=too-few-public-methods
def __init__(self, keyword, name): def __init__(self, keyword, name):
self.keyword = keyword self.keyword = keyword

1
patacrep/files.py

@ -1,7 +1,6 @@
"""File system utilities.""" """File system utilities."""
from contextlib import contextmanager from contextlib import contextmanager
import fnmatch
import importlib import importlib
import logging import logging
import os import os

2
patacrep/templates.py

@ -45,6 +45,7 @@ class VariablesExtension(Extension):
"""Extension to jinja2 to silently ignore variable block. """Extension to jinja2 to silently ignore variable block.
Instead, they are parsed by this module. Instead, they are parsed by this module.
""" """
# pylint: disable=too-few-public-methods
tags = set(['variables']) tags = set(['variables'])
def parse(self, parser): def parse(self, parser):
@ -66,6 +67,7 @@ def _escape_tex(value):
class TexRenderer: class TexRenderer:
"""Render a template to a LaTeX file.""" """Render a template to a LaTeX file."""
# pylint: disable=too-few-public-methods
def __init__(self, template, texenv, encoding=None): def __init__(self, template, texenv, encoding=None):
self.encoding = encoding self.encoding = encoding

Loading…
Cancel
Save