mailr16564 - /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 - 16:12:
Author: bugman
Date: Thu May 31 16:12:01 2012
New Revision: 16564

URL: http://svn.gna.org/viewcvs/relax?rev=16564&view=rev
Log:
The Desc_container object now supports itemised lists.


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=16564&r1=16563&r2=16564&view=diff
==============================================================================
--- branches/uf_redesign/user_functions/objects.py (original)
+++ branches/uf_redesign/user_functions/objects.py Thu May 31 16:12:01 2012
@@ -97,6 +97,25 @@
         # Initialise internal storage objects.
         self._data = []
         self._types = []
+
+
+    def add_item_list_element(self, item, text):
+        """Add the element of an itemised list to the description.
+
+        @param item:    The item text.
+        @type item:     str
+        @param text:    The itemised list element text.
+        @type text:     str
+        """
+
+        # Create a new block if needed.
+        if self._types[-1] != 'item list':
+            self._data.append([[item, text]])
+            self._types.append('item list')
+
+        # Append the element to an existing itemised list structure.
+        else:
+            self._data[-1].append([item, text])
 
 
     def add_list_element(self, text):




Related Messages


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