remove debug code
This commit is contained in:
parent
e9b9a8bf3f
commit
80a10956ed
15
CHANGES.rst
15
CHANGES.rst
@ -1,14 +1,3 @@
|
||||
0.1.7 (2015-01-02)
|
||||
0.1.2 (2015-03-13)
|
||||
------------------
|
||||
- add CHANGES.rst file
|
||||
- add a Quickstat in documentation
|
||||
|
||||
0.1.6 (2015-01-01)
|
||||
------------------
|
||||
- add docstrings
|
||||
- add sphinx doc
|
||||
|
||||
0.1.1 (2014-12-30)
|
||||
------------------
|
||||
- First commit
|
||||
- No doc
|
||||
- First running version
|
||||
@ -24,9 +24,6 @@ class DocxTemplate(object):
|
||||
def build_xml(self,context):
|
||||
src_xml = etree.tostring(self.docx._element.body, pretty_print=True)
|
||||
|
||||
with open('/tmp/docx1.xml','w') as fh:
|
||||
fh.write(src_xml)
|
||||
|
||||
# strip all xml tags inside {% %} and {{ }}
|
||||
# that Microsoft word can insert into xml code for this part of the document
|
||||
def striptags(m):
|
||||
@ -49,9 +46,6 @@ class DocxTemplate(object):
|
||||
# replace xml code corresponding to the paragraph containing {% p-xxx template tag by {% xxx template tag itself
|
||||
src_xml = re.sub(r'<w:p[ >](?:(?!<w:p[ >]).)*{%\s*p-([^%]*%}).*?</w:p>',r'{% \1',src_xml,flags=re.DOTALL)
|
||||
|
||||
with open('/tmp/docx2.xml','w') as fh:
|
||||
fh.write(src_xml)
|
||||
|
||||
template = Template(src_xml)
|
||||
dst_xml = template.render(context)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user