mailr26674 - in /branches/frame_order_cleanup: ./ dep_check.py lib/spectrum/nmrpipe.py


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

Header


Content

Posted by edward on November 20, 2014 - 19:26:
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://bugman@xxxxxxxxxxx/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()
 
 




Related Messages


Powered by MHonArc, Updated Fri Nov 21 09:00:03 2014