From 1e6ca278165c618f6df2569aa3c2a4e6af069c15 Mon Sep 17 00:00:00 2001 From: Louis Date: Fri, 4 Apr 2014 19:10:49 +0200 Subject: [PATCH] Pylint --- songbook_core/templates.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/songbook_core/templates.py b/songbook_core/templates.py index 5e16c5c5..e5bb9dd0 100644 --- a/songbook_core/templates.py +++ b/songbook_core/templates.py @@ -2,7 +2,8 @@ # -*- coding: utf-8 -*- """Template for .tex generation settings and utilities""" -from jinja2 import Environment, FileSystemLoader, ChoiceLoader, PackageLoader, TemplateNotFound, nodes +from jinja2 import Environment, FileSystemLoader, ChoiceLoader, PackageLoader, \ + TemplateNotFound, nodes from jinja2.ext import Extension from jinja2.meta import find_referenced_templates as find_templates import os @@ -21,13 +22,20 @@ _LATEX_SUBS = ( ) class VariablesExtension(Extension): + """Extension to jinja2 to silently ignore variable block. + + Instead, they are parsed by this module. + """ tags = set(['variables']) def parse(self, parser): parser.stream.next() - parser.parse_statements(end_tokens=['name:endvariables'], drop_needle=True) + parser.parse_statements( + end_tokens=['name:endvariables'], + drop_needle=True, + ) return nodes.Const("")