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
|
- First running version
|
||||||
- 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
|
|
||||||
@ -24,9 +24,6 @@ class DocxTemplate(object):
|
|||||||
def build_xml(self,context):
|
def build_xml(self,context):
|
||||||
src_xml = etree.tostring(self.docx._element.body, pretty_print=True)
|
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 {{ }}
|
# strip all xml tags inside {% %} and {{ }}
|
||||||
# that Microsoft word can insert into xml code for this part of the document
|
# that Microsoft word can insert into xml code for this part of the document
|
||||||
def striptags(m):
|
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
|
# 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)
|
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)
|
template = Template(src_xml)
|
||||||
dst_xml = template.render(context)
|
dst_xml = template.render(context)
|
||||||
|
|
||||||
|
|||||||
2
setup.py
2
setup.py
@ -24,7 +24,7 @@ News
|
|||||||
""" % read('README', 'CHANGES')
|
""" % read('README', 'CHANGES')
|
||||||
|
|
||||||
setup(name='docxtpl',
|
setup(name='docxtpl',
|
||||||
version='0.1.1',
|
version='0.1.2',
|
||||||
description='Python docx template engine',
|
description='Python docx template engine',
|
||||||
long_description=long_description,
|
long_description=long_description,
|
||||||
classifiers=[
|
classifiers=[
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user