diff options
| author | Naresh Choksy <nch@tinyerp.com> | 2009-05-12 16:49:55 +0530 |
|---|---|---|
| committer | Naresh Choksy <nch@tinyerp.com> | 2009-05-12 16:49:55 +0530 |
| commit | 9fa12bafaa9cd78c43490be36fcb76b3d197b7ea (patch) | |
| tree | bc484eb4f16cf5e691e0436aa89d7b0ca2ab4cb4 /bin/report/render/rml2pdf/utils.py | |
| parent | c54fa973e060dceb6da89a4160ce32d8dbe408a0 (diff) | |
Bugfix:setTag
bzr revid: nch@tinyerp.com-20090512111955-x70z0zu770k0qq8x
Diffstat (limited to 'bin/report/render/rml2pdf/utils.py')
| -rw-r--r-- | bin/report/render/rml2pdf/utils.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/bin/report/render/rml2pdf/utils.py b/bin/report/render/rml2pdf/utils.py index 2102912e974..ce54c50a9a5 100644 --- a/bin/report/render/rml2pdf/utils.py +++ b/bin/report/render/rml2pdf/utils.py @@ -40,6 +40,7 @@ import re import reportlab from lxml import etree +import copy _regex = re.compile('\[\[(.+?)\]\]') @@ -47,6 +48,7 @@ def _child_get(node, self=None, tagname=None): for n in node: if self and self.localcontext and n.get('rml_loop', False): oldctx = self.localcontext + for ctx in eval(n.get('rml_loop'),{}, self.localcontext): self.localcontext.update(ctx) if (tagname is None) or (n.tag==tagname): @@ -58,7 +60,7 @@ def _child_get(node, self=None, tagname=None): if n.get('rml_tag'): try: (tag,attr) = eval(n.get('rml_tag'),{}, self.localcontext) - n2 = copy.copy(n) + n2 = copy.deepcopy(n) n2.tag = tag n2.attrib.update(attr) yield n2 @@ -73,6 +75,16 @@ def _child_get(node, self=None, tagname=None): eval(n.get('rml_except'), {}, self.localcontext) except: continue + if self and self.localcontext and n.get('rml_tag', False): + try: + (tag,attr) = eval(n.get('rml_tag'),{}, self.localcontext) + n2 = copy.deepcopy(n) + n2.tag = tag + n2.attrib.update(attr) + yield n2 + tagname = '' + except: + pass if (tagname is None) or (n.tag==tagname): yield n |
