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.""" _______________________________________________ relax (http://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