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: _______________________________________________ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits