Author: bugman Date: Thu Nov 20 19:26:05 2014 New Revision: 26674 URL: http://svn.gna.org/viewcvs/relax?rev=26674&view=rev Log: Merged revisions 26667,26670 via svnmerge from svn+ssh://bug...@svn.gna.org/svn/relax/trunk
........ r26667 | bugman | 2014-11-20 15:58:14 +0100 (Thu, 20 Nov 2014) | 9 lines Big Python 3 bug fix for the dep_check module for the detection of the NMRPipe showApod software. The showApod program was falsely detected as always not being present when using Python 3. This is because the output of the program was being tested using string comparisons. However the output from programs obtained from the subprocess module is no longer strings but rather byte-arrays in Python 3. Therefore the byte-array is not being converted to text if Python 3 is being used, allowing the showApod software to be detected. ........ r26670 | bugman | 2014-11-20 16:39:20 +0100 (Thu, 20 Nov 2014) | 6 lines Python 3 bug fix for the lib.spectrum.nmrpipe.show_apod_extract() function. The subprocess module output from the showApod program, or any software, is a byte array in Python 3 rather than text. This is now detected and the byte array converted to text before any processing. ........ Modified: branches/frame_order_cleanup/ (props changed) branches/frame_order_cleanup/dep_check.py branches/frame_order_cleanup/lib/spectrum/nmrpipe.py Propchange: branches/frame_order_cleanup/ ------------------------------------------------------------------------------ --- svnmerge-integrated (original) +++ svnmerge-integrated Thu Nov 20 19:26:05 2014 @@ -1 +1 @@ -/trunk:1-26665 +/trunk:1-26673 Modified: branches/frame_order_cleanup/dep_check.py URL: http://svn.gna.org/viewcvs/relax/branches/frame_order_cleanup/dep_check.py?rev=26674&r1=26673&r2=26674&view=diff ============================================================================== --- branches/frame_order_cleanup/dep_check.py (original) +++ branches/frame_order_cleanup/dep_check.py Thu Nov 20 19:26:05 2014 @@ -268,8 +268,13 @@ # Split the output into lines. line_split = output.splitlines() + # The first line, decoding Python 3 byte arrays. + line = line_split[0] + if hasattr(line, 'decode'): + line = line.decode() + # Now make test. - if line_split[0] == 'showApod: Show Effect of Processing on Noise and Linewidth.': + if line == 'showApod: Show Effect of Processing on Noise and Linewidth.': showApod_software = True else: showApod_software = False Modified: branches/frame_order_cleanup/lib/spectrum/nmrpipe.py URL: http://svn.gna.org/viewcvs/relax/branches/frame_order_cleanup/lib/spectrum/nmrpipe.py?rev=26674&r1=26673&r2=26674&view=diff ============================================================================== --- branches/frame_order_cleanup/lib/spectrum/nmrpipe.py (original) +++ branches/frame_order_cleanup/lib/spectrum/nmrpipe.py Thu Nov 20 19:26:05 2014 @@ -226,6 +226,10 @@ # Wait for finish and get return code. return_value = Temp.wait() + # Python 3 support - convert byte arrays to text. + if hasattr(output, 'decode'): + output = output.decode() + return output.splitlines() _______________________________________________ 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