Browse Source

[pylint] cleaning

pull/184/head
Oliverpool 9 years ago
parent
commit
615dc00992
  1. 4
      patacrep/build.py
  2. 13
      patacrep/templates.py
  3. 1
      patacrep/utils.py
  4. 1
      test/test_song/test_parser.py

4
patacrep/build.py

@ -8,9 +8,7 @@ import threading
import os.path import os.path
from subprocess import Popen, PIPE, call, check_call from subprocess import Popen, PIPE, call, check_call
import yaml from patacrep import authors, content, errors, files, utils
from patacrep import authors, content, errors, encoding, files, utils
from patacrep.index import process_sxd from patacrep.index import process_sxd
from patacrep.templates import TexBookRenderer, iter_bookoptions from patacrep.templates import TexBookRenderer, iter_bookoptions
from patacrep.songs import DataSubpath, DEFAULT_CONFIG from patacrep.songs import DataSubpath, DEFAULT_CONFIG

13
patacrep/templates.py

@ -9,7 +9,7 @@ from jinja2 import Environment, FileSystemLoader, ChoiceLoader, \
from jinja2.ext import Extension from jinja2.ext import Extension
from jinja2.meta import find_referenced_templates as find_templates from jinja2.meta import find_referenced_templates as find_templates
from patacrep import errors, files, utils, Rx from patacrep import errors, files, utils
from patacrep.latex import lang2babel from patacrep.latex import lang2babel
import patacrep.encoding import patacrep.encoding
@ -143,7 +143,8 @@ class TexBookRenderer(Renderer):
variables[name] = self._get_variables(param, template_config) variables[name] = self._get_variables(param, template_config)
return variables return variables
def _get_variables(self, parameter, user_config): @staticmethod
def _get_variables(parameter, user_config):
'''Get the default value for the parameter, according to the language. '''Get the default value for the parameter, according to the language.
''' '''
schema = parameter.get('schema', {}).copy() schema = parameter.get('schema', {}).copy()
@ -177,10 +178,10 @@ class TexBookRenderer(Renderer):
continue continue
subtemplate = self.jinjaenv.get_template(subtemplate) subtemplate = self.jinjaenv.get_template(subtemplate)
variables.update(self.get_template_variables( variables.update(self.get_template_variables(
subtemplate, subtemplate,
skip + templates skip + templates
) )
) )
return variables return variables
def parse_template(self, template): def parse_template(self, template):

1
patacrep/utils.py

@ -102,7 +102,6 @@ def validate_config_schema(config):
""" """
data = config.copy() data = config.copy()
rx_checker = Rx.Factory({"register_core_types": True})
schema_path = pkg_datapath('templates', 'songbook_schema.yml') schema_path = pkg_datapath('templates', 'songbook_schema.yml')
with encoding.open_read(schema_path) as schema_file: with encoding.open_read(schema_path) as schema_file:
schema_struct = yaml.load(schema_file) schema_struct = yaml.load(schema_file)

1
test/test_song/test_parser.py

@ -11,7 +11,6 @@ from pkg_resources import resource_filename
import yaml import yaml
from patacrep import files, pkg_datapath from patacrep import files, pkg_datapath
from patacrep.songs import DEFAULT_CONFIG
from patacrep.encoding import open_read from patacrep.encoding import open_read
from .. import logging_reduced from .. import logging_reduced

Loading…
Cancel
Save