diff options
| author | Xavier Morel <xmo@tinyerp.com> | 2009-11-28 11:48:10 +0100 |
|---|---|---|
| committer | Xavier Morel <xmo@tinyerp.com> | 2009-11-28 11:48:10 +0100 |
| commit | 44a11226fe23c693c65036f8a94ba70bad154bcf (patch) | |
| tree | ee29a45f4f8ed812dce21162baa38b465b1656fb /bin/report/render/rml2html/rml2html.py | |
| parent | ce28b92c9e314579334271a58fcf4c5c65873e36 (diff) | |
[IMP] improve usage of the ET API, use SubElement instead of Element/append, kwarg attributes setting instead of node.set
bzr revid: xmo@tinyerp.com-20091128104810-52uhz28fiw53joaz
Diffstat (limited to 'bin/report/render/rml2html/rml2html.py')
| -rw-r--r-- | bin/report/render/rml2html/rml2html.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/bin/report/render/rml2html/rml2html.py b/bin/report/render/rml2html/rml2html.py index 5e7bb5cf4e9..ea2a5583250 100644 --- a/bin/report/render/rml2html/rml2html.py +++ b/bin/report/render/rml2html/rml2html.py @@ -104,12 +104,10 @@ class _flowable(object): process(node,new_node) if new_node.get('colWidths',False): sizes = map(lambda x: utils.unit_get(x), new_node.get('colWidths').split(',')) - tr = etree.Element('tr') + tr = etree.SubElement(new_node, 'tr') for s in sizes: - td = etree.Element('td') - td.set("width", str(s)) - tr.append(td) - new_node.append(tr) + etree.SubElement(tr, 'td', width=str(s)) + return etree.tostring(new_node) def _tag_para(self, node): @@ -458,4 +456,4 @@ if __name__=="__main__": print 'Usage: trml2pdf input.rml >output.pdf' print 'Try \'trml2pdf --help\' for more information.' -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
