Module Expr Str Import alias Import alias ImportFrom alias ClassDef bases body FunctionDef arguments args NameParam NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return Call NameLoad AttributeLoad NameLoad attr decorator_list decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Str FunctionDef arguments args defaults body For NameStore NameLoad body Expr Yield NameLoad decorator_list Assign NameStore Call NameLoad keyword NameLoad Print ListComp Call NameLoad AttributeLoad NameLoad attr comprehension NameStore Call NameLoad Assign NameStore BinOpMod Str NameLoad If Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Print Str NameLoad decorator_list FunctionDef arguments args defaults body Import alias Expr Call AttributeLoad NameLoad attr decorator_list If CompareEq NameLoad Str body Expr Call NameLoad
N/A N/A 

If I repeat a paragraph using the following formula::

  do text for pp in properties_list()

and if `properties_list()` is a generator function, 
then appy.pod works only correctly 
if the generator function actually yields values.

The following test works:

>>> run_test(1,[
... Property("Computer","good"),
... Property("Singing","very good")])
[u'Computer', u'Singing']
Generated file result1.odt

If it is an empty generator
        
But the following expected result doesn't work:

>>> run_test(2,[])
[]
Generated file result1.odt

It gives the following traceback instead:

Traceback (most recent call last):
  File "test.py", line 44, in <module>
    run_test(2,[])
  File "test.py", line 33, in run_test
    renderer.run()
  File "l:\snapshots\appy-0.6.7\appy\pod\renderer.py", line 347, in run
    self.currentParser.parse(self.contentXml)
  File "l:\snapshots\appy-0.6.7\appy\shared\xml_parser.py", line 195, in parse
    self.parser.parse(inputSource)
  File "c:\Python27\lib\xml\sax\expatreader.py", line 107, in parse
    xmlreader.IncrementalParser.parse(self, source)
  File "c:\Python27\lib\xml\sax\xmlreader.py", line 123, in parse
    self.feed(buffer)
  File "c:\Python27\lib\xml\sax\expatreader.py", line 207, in feed
    self._parser.Parse(data, isFinal)
  File "c:\Python27\lib\xml\sax\expatreader.py", line 304, in end_element
    self._cont_handler.endElement(name)
  File "l:\snapshots\appy-0.6.7\appy\pod\pod_parser.py", line 279, in endElement
    e.currentBuffer.action.execute()
  File "l:\snapshots\appy-0.6.7\appy\pod\actions.py", line 76, in execute
    self.do()
  File "l:\snapshots\appy-0.6.7\appy\pod\actions.py", line 198, in do
    del context[self.iter]
KeyError: u'pp'

Tested also on 0.7.0

A workaround is to change the formula in the .odt template 
to wrap the iterator manually into `list`:

  do text for pp in list(properties_list())

Not urgent, but worth a closer look.

 N/A os N/A os.path appy.pod.renderer Renderer Property N/A N/A __init__ N/A N/A self property value N/A N/A N/A N/A self property property N/A N/A self value value N/A __unicode__ N/A N/A self N/A N/A N/A N/A unicode N/A self value N/A N/A run_test N/A N/A n pp_list N/A N/A N/A tpl N/A N/A N/A os path join N/A N/A N/A os path abspath N/A N/A N/A os path dirname __file__ cv.odt properties_list N/A N/A N/A N/A N/A p pp_list N/A N/A N/A p N/A N/A context N/A dict properties_list properties_list N/A N/A N/A unicode N/A pp property N/A pp N/A properties_list N/A target N/A result%s.odt n N/A N/A N/A N/A os path exists target N/A N/A N/A N/A os remove target N/A renderer N/A Renderer tpl context target N/A N/A N/A renderer run N/A Generated file target N/A _test N/A N/A N/A N/A N/A doctest N/A N/A N/A doctest testmod N/A N/A N/A __name__ __main__ N/A N/A N/A _test