mailr3822 - /1.3/relax_io.py


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

Header


Content

Posted by edward on November 22, 2007 - 17:19:
Author: bugman
Date: Thu Nov 22 17:19:25 2007
New Revision: 3822

URL: http://svn.gna.org/viewcvs/relax?rev=3822&view=rev
Log:
Converted the strip class method to a module function.


Modified:
    1.3/relax_io.py

Modified: 1.3/relax_io.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/relax_io.py?rev=3822&r1=3821&r2=3822&view=diff
==============================================================================
--- 1.3/relax_io.py (original)
+++ 1.3/relax_io.py Thu Nov 22 17:19:25 2007
@@ -257,6 +257,31 @@
         return file_obj
 
 
+def strip(data):
+    """Function to remove all comment and empty lines from the file data 
structure."""
+
+    # Initialise the new data array.
+    new = []
+
+    # Loop over the data.
+    for i in xrange(len(data)):
+        # Empty lines.
+        if len(data[i]) == 0:
+            continue
+
+        # Comment lines.
+        elif match("#", data[i][0]):
+            continue
+
+        # Data lines.
+        else:
+            new.append(data[i])
+
+    # Return the new data structure.
+    return new
+
+
+
 
 
 class IO:
@@ -345,30 +370,6 @@
         sys.stderr = self.python_stderr
 
 
-    def strip(self, data):
-        """Function to remove all comment and empty lines from the file data 
structure."""
-
-        # Initialise the new data array.
-        new = []
-
-        # Loop over the data.
-        for i in xrange(len(data)):
-            # Empty lines.
-            if len(data[i]) == 0:
-                continue
-
-            # Comment lines.
-            elif match("#", data[i][0]):
-                continue
-
-            # Data lines.
-            else:
-                new.append(data[i])
-
-        # Return the new data structure.
-        return new
-
-
     def tee(self, file_name=None, dir=None, compress_type=0, print_flag=1):
         """Function for turning logging on."""
 




Related Messages


Powered by MHonArc, Updated Thu Nov 22 17:40:10 2007