From 6a62711467381b7de2d66c78ada9cdc5b67bc325 Mon Sep 17 00:00:00 2001 From: "dsh (Open ERP)" Date: Thu, 4 Jun 2009 16:58:39 +0530 Subject: bug fix(skip text if child nodes are there) for the html2html and openoffice reports bzr revid: dsh@tinyerp.com-20090604112839-91d7pj22oos69wsd --- bin/report/render/html2html/html2html.py | 1 + 1 file changed, 1 insertion(+) (limited to 'bin/report/render/html2html/html2html.py') diff --git a/bin/report/render/html2html/html2html.py b/bin/report/render/html2html/html2html.py index d4fa8559720..2cf5b147dd0 100644 --- a/bin/report/render/html2html/html2html.py +++ b/bin/report/render/html2html/html2html.py @@ -47,6 +47,7 @@ class html2html(object): new_node.append(new_child) if len(child): for n in new_child: + new_child.text = utils._process_text(self, child.text) new_child.remove(n) process_text(child, new_child) else: -- cgit v1.2.3 From 683f3fe232c5a696bd00d9ec10a69af7d36fcb4a Mon Sep 17 00:00:00 2001 From: "dsh (Open ERP)" Date: Wed, 10 Jun 2009 16:53:28 +0530 Subject: [IMP] added style for the url which are as text bzr revid: dsh@tinyerp.com-20090610112328-0rd3cr2ig132yt12 --- bin/report/render/html2html/html2html.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'bin/report/render/html2html/html2html.py') diff --git a/bin/report/render/html2html/html2html.py b/bin/report/render/html2html/html2html.py index 2cf5b147dd0..1fc63572a0f 100644 --- a/bin/report/render/html2html/html2html.py +++ b/bin/report/render/html2html/html2html.py @@ -71,8 +71,20 @@ class html2html(object): self._node.remove(n) process_text(self.etree, self._node) return self._node + + def url_modify(self,root): + for n in root.getchildren(): + if n.text.find('=0 and n.text.find('style')<=0 : + node = (n.tag=='span' and n.getparent().tag=='u') and n.getparent().getparent() or ((n.tag=='span') and n.getparent()) or n + style = node.get('color') and "style='color:%s; text-decoration: none;'"%node.get('color') or '' + href = n.text.split(' Date: Wed, 10 Jun 2009 19:19:19 +0530 Subject: [FIX] fix &,<,> problem for html2html-url report bzr revid: dsh@tinyerp.com-20090610134919-x3hkueo10dlrqkn5 --- bin/report/render/html2html/html2html.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'bin/report/render/html2html/html2html.py') diff --git a/bin/report/render/html2html/html2html.py b/bin/report/render/html2html/html2html.py index 1fc63572a0f..db6a1ea511c 100644 --- a/bin/report/render/html2html/html2html.py +++ b/bin/report/render/html2html/html2html.py @@ -74,11 +74,15 @@ class html2html(object): def url_modify(self,root): for n in root.getchildren(): - if n.text.find('=0 and n.text.find('style')<=0 : + if (n.text.find('=0 or n.text.find('<a')>=0) and n.text.find('href')>=0 and n.text.find('style')<=0 : node = (n.tag=='span' and n.getparent().tag=='u') and n.getparent().getparent() or ((n.tag=='span') and n.getparent()) or n style = node.get('color') and "style='color:%s; text-decoration: none;'"%node.get('color') or '' - href = n.text.split('=0: + t = '<a ' + else : + t = ' Date: Thu, 18 Jun 2009 17:57:42 +0530 Subject: [FIX] fix missing tail process and skip unnecessary whitespace characters bzr revid: dsh@tinyerp.com-20090618122742-we73sy313qem28zu --- bin/report/render/html2html/html2html.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'bin/report/render/html2html/html2html.py') diff --git a/bin/report/render/html2html/html2html.py b/bin/report/render/html2html/html2html.py index db6a1ea511c..fa07e9b4726 100644 --- a/bin/report/render/html2html/html2html.py +++ b/bin/report/render/html2html/html2html.py @@ -30,7 +30,7 @@ import re from reportlab.lib.utils import ImageReader _regex = re.compile('\[\[(.+?)\]\]') - +utils._regex = re.compile('\[\[\s*(.+?)\s*\]\]',re.DOTALL) class html2html(object): def __init__(self, html, localcontext): self.localcontext = localcontext @@ -48,6 +48,7 @@ class html2html(object): if len(child): for n in new_child: new_child.text = utils._process_text(self, child.text) + new_child.tail = utils._process_text(self, child.tail) new_child.remove(n) process_text(child, new_child) else: @@ -66,6 +67,7 @@ class html2html(object): else : new_child.getparent().remove(new_child) new_child.text = utils._process_text(self, child.text) + new_child.tail = utils._process_text(self, child.tail) self._node = copy.deepcopy(self.etree) for n in self._node: self._node.remove(n) -- cgit v1.2.3