Author: bugman Date: Sun Jun 3 15:00:10 2012 New Revision: 16608 URL: http://svn.gna.org/viewcvs/relax?rev=16608&view=rev Log: The Desc_container.element_loop() method can now yield the title too, if asked. Modified: branches/uf_redesign/user_functions/objects.py Modified: branches/uf_redesign/user_functions/objects.py URL: http://svn.gna.org/viewcvs/relax/branches/uf_redesign/user_functions/objects.py?rev=16608&r1=16607&r2=16608&view=diff ============================================================================== --- branches/uf_redesign/user_functions/objects.py (original) +++ branches/uf_redesign/user_functions/objects.py Sun Jun 3 15:00:10 2012 @@ -192,12 +192,18 @@ self._types.append('verbatim') - def element_loop(self): + def element_loop(self, title=False): """Iterator method yielding the description elements. + @keyword title: A flag which if True will cause the title to be yielded first. + @type title: bool @return: The element type and corresponding data. @rtype: str and anything """ + + # The title. + if title: + yield 'title', self._title # Loop over the elements. for i in range(len(self._data)):