diff options
| author | Xavier Morel <xmo@tinyerp.com> | 2009-11-28 11:01:04 +0100 |
|---|---|---|
| committer | Xavier Morel <xmo@tinyerp.com> | 2009-11-28 11:01:04 +0100 |
| commit | 752e88e5212aba2b4afa2a0448534bb0a0d7bccd (patch) | |
| tree | 6bb2aaeb86b065f5cce2c95bca736609c225a51c /bin/report/custom.py | |
| parent | fdcbed339b52e6e8f8170c7259f6a502d9bb028d (diff) | |
[FIX] Remove leftover instances of libxslt and libxml2, replace them by lxml
bzr revid: xmo@tinyerp.com-20091128100104-n0s3sv3p1601mn50
Diffstat (limited to 'bin/report/custom.py')
| -rw-r--r-- | bin/report/custom.py | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/bin/report/custom.py b/bin/report/custom.py index 4c0c9b1ece0..0f770a8760a 100644 --- a/bin/report/custom.py +++ b/bin/report/custom.py @@ -34,11 +34,10 @@ from osv.orm import browse_null from osv.orm import browse_record_list import pooler from xml.dom import minidom -import libxml2 -import libxslt from pychart import * import misc import cStringIO +from lxml import etree class external_pdf(render.render): def __init__(self, pdf): @@ -351,11 +350,11 @@ class report_custom(report_int): new_doc.childNodes[0].appendChild(lines) - styledoc = libxml2.parseFile(os.path.join(tools.config['root_path'],'addons/base/report/custom_new.xsl')) - style = libxslt.parseStylesheetDoc(styledoc) - doc = libxml2.parseDoc(new_doc.toxml()) - rml_obj = style.applyStylesheet(doc, None) - rml = style.saveResultToString(rml_obj) + transform = etree.XSLT( + etree.parse(os.path.join(tools.config['root_path'], + 'addons/base/report/custom_new.xsl'))) + rml = etree.tostring( + transform(etree.fromstring(new_doc.toxml()))) self.obj = render.rml(rml) self.obj.render() @@ -649,13 +648,11 @@ class report_custom(report_int): new_doc.childNodes[0].appendChild(lines) -# file('/tmp/terp.xml','w+').write(new_doc.toxml()) - - styledoc = libxml2.parseFile(os.path.join(tools.config['root_path'],'addons/base/report/custom_new.xsl')) - style = libxslt.parseStylesheetDoc(styledoc) - doc = libxml2.parseDoc(new_doc.toxml()) - rml_obj = style.applyStylesheet(doc, None) - rml = style.saveResultToString(rml_obj) + transform = etree.XSLT( + etree.parse(os.path.join(tools.config['root_path'], + 'addons/base/report/custom_new.xsl'))) + rml = etree.tostring( + transform(etree.fromstring(new_doc.toxml()))) self.obj = render.rml(rml) self.obj.render() |
