mailr18711 - /trunk/lib/text/table.py


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

Header


Content

Posted by edward on March 08, 2013 - 17:30:
Author: bugman
Date: Fri Mar  8 17:30:20 2013
New Revision: 18711

URL: http://svn.gna.org/viewcvs/relax?rev=18711&view=rev
Log:
Fix for lib.text.table.format_table() when more than one multi-column cell 
per row is encountered.

The algorithm for determining the total width of the multi-column cell in 
_table_line() was not
checking if the end of the span was being reached.


Modified:
    trunk/lib/text/table.py

Modified: trunk/lib/text/table.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/lib/text/table.py?rev=18711&r1=18710&r2=18711&view=diff
==============================================================================
--- trunk/lib/text/table.py (original)
+++ trunk/lib/text/table.py Fri Mar  8 17:30:20 2013
@@ -67,6 +67,10 @@
     for i in range(len(data)):
         # Loop over the columns.
         for j in range(len(data[i])):
+            # Skip multi-columns.
+            if data[i][j] == MULTI_COL:
+                continue
+
             # Default left justification.
             justification[i][j] = 'l'
 
@@ -159,6 +163,8 @@
             for j in range(i+1, num_col):
                 if text[j] == MULTI_COL:
                     width += len(separator) + widths[j]
+                else:
+                    break
 
             # Add the padded text.
             if justification[i] == 'l':




Related Messages


Powered by MHonArc, Updated Fri Mar 08 18:20:02 2013