Author: bugman Date: Sat Jun 2 19:41:10 2012 New Revision: 16602 URL: http://svn.gna.org/viewcvs/relax?rev=16602&view=rev Log: Fixes for the prompt UI construction of the tables. The top line was sometimes one '_' character too long. Now the correct table width is calculated as it may not always match status.text_width. Modified: branches/uf_redesign/prompt/uf_docstring.py Modified: branches/uf_redesign/prompt/uf_docstring.py URL: http://svn.gna.org/viewcvs/relax/branches/uf_redesign/prompt/uf_docstring.py?rev=16602&r1=16601&r2=16602&view=diff ============================================================================== --- branches/uf_redesign/prompt/uf_docstring.py (original) +++ branches/uf_redesign/prompt/uf_docstring.py Sat Jun 2 19:41:10 2012 @@ -125,9 +125,8 @@ used += 3 * (num_cols - 1) # Middle of the table ' | '. free_space = status.text_width - used - # The total table width. + # The maximal width for all cells. free_width = sum(widths) - total_width = free_width + used # Column wrapping. if free_width > free_space: @@ -137,16 +136,12 @@ print("Table column wrapping algorithm:") print("%-20s %s" % ("num_cols:", num_cols)) print("%-20s %s" % ("free space:", free_space)) - print("%-20s %s" % ("total_width:", total_width)) # New structures. new_widths = deepcopy(widths) num_cols_wrap = num_cols free_space_wrap = free_space col_wrap = [True] * num_cols - - # New total width. - total_width = status.text_width # Loop. while 1: @@ -197,6 +192,9 @@ new_widths = widths col_wrap = [False] * num_cols + # The total table width. + total_width = sum(new_widths) + used + # The header. text += "_" * total_width + "\n" # Top rule. text += table_line(widths=new_widths) # Blank line.