flake8 fixes
This commit is contained in:
parent
344a7d1676
commit
4af6f2282f
@ -248,17 +248,16 @@ class DocxTemplate(object):
|
|||||||
def resolve_run(paragraph_properties, m):
|
def resolve_run(paragraph_properties, m):
|
||||||
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 ''
|
||||||
|
return re.sub(r'<w:t(?:[^>]*)?>.*?</w:t>',
|
||||||
p_resolve_text = lambda x: resolve_text(run_properties, paragraph_properties, x)
|
lambda x: resolve_text(run_properties, paragraph_properties, x), m[0],
|
||||||
return re.sub(r'<w:t(?:[^>]*)?>.*?</w:t>', p_resolve_text, m[0], flags=re.DOTALL)
|
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 ''
|
||||||
|
return re.sub(r'<w:r(?:[^>]*)?>.*?</w:r>',
|
||||||
p_resolve_run = lambda x: resolve_run(paragraph_properties, x)
|
lambda x: resolve_run(paragraph_properties, x),
|
||||||
|
m[0], flags=re.DOTALL)
|
||||||
return re.sub(r'<w:r(?:[^>]*)?>.*?</w:r>', p_resolve_run, m[0], flags=re.DOTALL)
|
|
||||||
|
|
||||||
xml = re.sub(r'<w:p(?:[^>]*)?>.*?</w:p>', resolve_paragraph, xml, flags=re.DOTALL)
|
xml = re.sub(r'<w:p(?:[^>]*)?>.*?</w:p>', resolve_paragraph, xml, flags=re.DOTALL)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user