Beginners issue with nested dos

Asked by David Björkevik on 2014-06-23

Hi! I'm trying out appy.pod as a report generator. I try to set up a really minimal example with a ods template using conditional columns, which causes an exception in appy. Have I just got things very wrong or does this simple use case trigger a bug?

Code is below. appytest.ods is at


from appy.pod.renderer import Renderer

staff = [{'firstName': 'Delannay', 'name': 'Gaetan', 'age': 112},
         {'firstName': 'Gauthier', 'name': 'Bastien', 'age': 5},
         {'firstName': 'Jean-Michel', 'name': 'Abe', 'age': 79}]

renderer = Renderer('appytest.ods', {
                                     "print_age": False
                                     }, 'result.ods',

Question information

English Edit question
Appy Edit question
No assignee Edit question
Last query:
Last reply:
David Björkevik (o-david-r) said : #1

Forgot to add the traceback I get from running this:
Traceback (most recent call last):
  File "", line 12, in <module>
  File "/home/david/tmp/appytest/appy/pod/", line 430, in run
  File "/home/david/tmp/appytest/appy/shared/", line 262, in parse
  File "/usr/lib64/python2.7/xml/sax/", line 107, in parse
    xmlreader.IncrementalParser.parse(self, source)
  File "/usr/lib64/python2.7/xml/sax/", line 123, in parse
  File "/usr/lib64/python2.7/xml/sax/", line 210, in feed
    self._parser.Parse(data, isFinal)
  File "/usr/lib64/python2.7/xml/sax/", line 307, in end_element
  File "/home/david/tmp/appytest/appy/pod/", line 317, in endElement
    isMainElement = e.currentBuffer.isMainElement(elem)
  File "/home/david/tmp/appytest/appy/pod/", line 287, in isMainElement
    if hasattr(mainElem, 'OD'): mainElem = mainElem.OD.elem
AttributeError: 'NoneType' object has no attribute 'elem'

The template file is made using LibreOffice For the above test i use the bzr trunk head, but it crashes in a similar way with latest stable release.

Hi David,
The conditional inclusion of columns is a tricky thing and does not work yet. If you remove your 2 "do cell" statements, it should work.

Can you help with this problem?

Provide an answer of your own, or ask David Björkevik for more information if necessary.

To post a message you must log in.