flake8 fixes

This commit is contained in:
Eric Lapouyade 2020-10-19 14:10:24 +02:00
parent 44a0819625
commit 344a7d1676
2 changed files with 5 additions and 5 deletions

View File

@ -1,9 +1,9 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
''' """
Created : 2015-03-12 Created : 2015-03-12
@author: Eric Lapouyade @author: Eric Lapouyade
''' """
__version__ = '0.11.0' __version__ = '0.11.0'
import functools import functools
@ -249,14 +249,14 @@ class DocxTemplate(object):
run_properties = re.search(r'<w:rPr>.*</w:rPr>', m[0]) run_properties = re.search(r'<w:rPr>.*</w:rPr>', m[0])
run_properties = run_properties[0] if run_properties else '' run_properties = run_properties[0] if run_properties else ''
p_resolve_text = lambda x:resolve_text(run_properties, paragraph_properties, x) p_resolve_text = lambda x: resolve_text(run_properties, paragraph_properties, x)
return re.sub(r'<w:t(?:[^>]*)?>.*?</w:t>', p_resolve_text, m[0], flags=re.DOTALL) return re.sub(r'<w:t(?:[^>]*)?>.*?</w:t>', p_resolve_text, m[0], flags=re.DOTALL)
def resolve_paragraph(m): def resolve_paragraph(m):
paragraph_properties = re.search(r'<w:pPr>.*</w:pPr>', m[0]) paragraph_properties = re.search(r'<w:pPr>.*</w:pPr>', m[0])
paragraph_properties = paragraph_properties[0] if paragraph_properties else '' paragraph_properties = paragraph_properties[0] if paragraph_properties else ''
p_resolve_run = lambda x:resolve_run(paragraph_properties, x) p_resolve_run = lambda x: resolve_run(paragraph_properties, x)
return re.sub(r'<w:r(?:[^>]*)?>.*?</w:r>', p_resolve_run, m[0], flags=re.DOTALL) return re.sub(r'<w:r(?:[^>]*)?>.*?</w:r>', p_resolve_run, m[0], flags=re.DOTALL)

View File

@ -13,7 +13,7 @@ context = {
'the listing\nwith\nsome\nlines\nand special chars : <>& ...' 'the listing\nwith\nsome\nlines\nand special chars : <>& ...'
), ),
'page_break': R('\f'), 'page_break': R('\f'),
'new_listing':""" 'new_listing': """
This is a new listing This is a new listing
Now, does not require Listing() Object Now, does not require Listing() Object
Here is a \t tab\a Here is a \t tab\a