Ignore:
Timestamp:
26/02/08 18:36:04 (12 years ago)
Author:
ckilburn
Message:

Annotations and isolating reverses on write

File:
1 edited

Legend:

Unmodified
Added
Removed
  • nappy/trunk/nappy/na_file/na_file_2110.py

    r3491 r3521  
    1616import nappy.utils.text_parser 
    1717import nappy.na_file.na_file_2010 
     18import nappy.utils.common_utils 
     19wrapLine = nappy.utils.common_utils.annotateLine 
     20wrapLines = nappy.utils.common_utils.annotateLines 
    1821 
    1922class NAFile2110(nappy.na_file.na_file_2010.NAFile2010): 
     
    3841    def writeHeader(self): 
    3942        """ 
    40         Writes FFI-specifc header section. 
     43        Writes FFI-specific header section. 
    4144        """ 
    4245        self._writeCommonHeader() 
    43         self.DX.reverse() 
    44         self.header.write((("%s" + self.delimiter) * (self.NIV - 1) + "%s\n") % tuple(self.DX)) 
    45         self.XNAME.reverse() 
    46         self.header.write("%s\n" * self.NIV % tuple(self.XNAME)) 
     46        DX = self.DX 
     47        DX.reverse() 
     48        self.header.write(wrapLine("DX", self.annotation, self.delimiter, (("%s" + self.delimiter) * (self.NIV - 1) + "%s\n") % tuple(DX))) 
     49        XNAME = self.XNAME 
     50        XNAME.reverse() 
     51        self.header.write(wrapLines("XNAME", self.annotation, self.delimiter, "%s\n" * self.NIV % tuple(XNAME))) 
    4752        self._writeVariablesHeaderSection() 
    4853        self._writeAuxVariablesHeaderSection() 
     
    122127            for a in range(self.NAUXV):  
    123128                var_string = var_string + (self.format % self.A[a][m]) 
    124             self.file.write("%s\n" % var_string.rstrip(" ,")) 
     129            self.file.write(wrapLine("Data", self.annotation, self.delimiter, "%s\n" % var_string.rstrip(" ,"))) 
    125130 
    126131            # Write second independant variable and dependant variables 
     
    131136                    var_string = var_string + (self.format %self.V[n][m][p]) 
    132137 
    133                 self.file.write("%s\n" %var_string.rstrip(" ,")) 
     138                self.file.write(wrapLine("Data", self.annotation, self.delimiter, "%s\n" %var_string.rstrip(" ,"))) 
Note: See TracChangeset for help on using the changeset viewer.