mailr28276 - /trunk/gui/misc.py


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

Header


Content

Posted by edward on November 14, 2016 - 23:02:
Author: bugman
Date: Mon Nov 14 23:02:28 2016
New Revision: 28276

URL: http://svn.gna.org/viewcvs/relax?rev=28276&view=rev
Log:
Python 3 fixes for the gui.misc module.

This is for text formatting using the "x"*num logic.  In Python 3, num is 
often a float so this does
not work and an explicit int() function call is required.

Modified:
    trunk/gui/misc.py

Modified: trunk/gui/misc.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/gui/misc.py?rev=28276&r1=28275&r2=28276&view=diff
==============================================================================
--- trunk/gui/misc.py   (original)
+++ trunk/gui/misc.py   Mon Nov 14 23:02:28 2016
@@ -1,7 +1,7 @@
 
###############################################################################
 #                                                                            
 #
 # Copyright (C) 2009 Michael Bieri                                           
 #
-# Copyright (C) 2010-2013 Edward d'Auvergne                                  
 #
+# Copyright (C) 2010-2016 Edward d'Auvergne                                  
 #
 #                                                                            
 #
 # This file is part of the program relax (http://www.nmr-relax.com).         
 #
 #                                                                            
 #
@@ -212,7 +212,7 @@
     total_width = sum(new_widths) + used
 
     # The header.
-    text += " " + "_" * (total_width - 2) + "\n\n"    # Top rule and black 
line.
+    text += " " + "_" * int(total_width - 2) + "\n\n"    # Top rule and 
black line.
     text += table_line(text=table.headings, widths=new_widths)    # The 
headings.
     text += table_line(widths=new_widths, bottom=True)    # Middle rule.
 
@@ -353,16 +353,16 @@
 
         # A bottom line.
         if bottom:
-            line += "_" * widths[i]
+            line += "_" * int(widths[i])
 
         # Empty line.
         elif text == None:
-            line += " " * widths[i]
+            line += " " * int(widths[i])
 
         # The text.
         else:
             line += text[i]
-            line += " " * (widths[i] - len(text[i]))
+            line += " " * int(widths[i] - len(text[i]))
 
     # Close the line.
     if bottom:




Related Messages


Powered by MHonArc, Updated Mon Nov 14 23:20:11 2016