mailr16561 - /branches/uf_redesign/user_functions/objects.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on May 31, 2012 - 15:52:
Author: bugman
Date: Thu May 31 15:52:54 2012
New Revision: 16561

URL: http://svn.gna.org/viewcvs/relax?rev=16561&view=rev
Log:
The Desc_container.add_list_element() method now groups list elements 
together.


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=16561&r1=16560&r2=16561&view=diff
==============================================================================
--- branches/uf_redesign/user_functions/objects.py (original)
+++ branches/uf_redesign/user_functions/objects.py Thu May 31 15:52:54 2012
@@ -106,9 +106,14 @@
         @type text:     str
         """
 
-        # Store the text.
-        self._data.append(text)
-        self._types.append('list')
+        # Create a new block if needed.
+        if self._types[-1] != 'list':
+            self._data.append([text])
+            self._types.append('list')
+
+        # Append the element to an existing list structure.
+        else:
+            self._data[-1].append(text)
 
 
     def add_paragraph(self, text):
@@ -130,7 +135,7 @@
         @type text:     str
         """
 
-        # Create a block  if needed.
+        # Create a new block if needed.
         if self._types[-1] != 'prompt':
             self._data.append([text])
             self._types.append('prompt')




Related Messages


Powered by MHonArc, Updated Fri Jun 01 00:00:02 2012