mailr13700 - /branches/gui_testing/relax_io.py


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

Header


Content

Posted by edward on July 18, 2011 - 17:49:
Author: bugman
Date: Mon Jul 18 17:49:54 2011
New Revision: 13700

URL: http://svn.gna.org/viewcvs/relax?rev=13700&view=rev
Log:
Better support in DummyFileObject for the presence or absence of a trailing 
\n character.

This adds on the changes of r13252:

.....
  r13252 | bugman | 2011-06-28 10:59:52 +0200 (Tue, 28 Jun 2011) | 3 lines
  Changed paths:
     M /branches/gui_testing/relax_io.py
  
  Bug fix for the DummyFileObject class - the last line was not returned by 
readlines() even if it had data.
.....


Modified:
    branches/gui_testing/relax_io.py

Modified: branches/gui_testing/relax_io.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/gui_testing/relax_io.py?rev=13700&r1=13699&r2=13700&view=diff
==============================================================================
--- branches/gui_testing/relax_io.py (original)
+++ branches/gui_testing/relax_io.py Mon Jul 18 17:49:54 2011
@@ -971,6 +971,10 @@
         # Split up the string.
         lines = split(self.data, '\n')
 
+        # Remove the last line if empty.
+        if lines[-1] == '':
+            lines.pop()
+
         # Loop over the lines, re-adding the newline character to match the 
file object readlines() method.
         for i in xrange(len(lines)):
             lines[i] = lines[i] + '\n'




Related Messages


Powered by MHonArc, Updated Mon Jul 18 18:20:02 2011