Changeset 3354 for nappy


Ignore:
Timestamp:
10/02/08 20:27:36 (12 years ago)
Author:
astephen
Message:
 
Location:
nappy/trunk/nappy
Files:
2 edited

Legend:

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

    r3321 r3354  
    1616 
    1717# Imports from local package 
    18 import utils.text_parser 
    19 import nappy.na_file.na_file 
     18import nappy.utils.text_parser 
     19import nappy.na_file.na_file.na_file_1001 
    2020 
    2121class NAFile1010(nappy.na_file.na_file_1001.NAFile1001): 
     
    3030        """         
    3131        self._readCommonHeader() 
    32         self.DX = utils.text_parser.readItemsFromLine(self.file.readline(), self.NIV, float) 
    33         self.XNAME = utils.text_parser.readItemsFromLines(self._readLines(self.NIV), self.NIV, str) 
     32        self.DX = nappy.utils.text_parser.readItemsFromLine(self.file.readline(), self.NIV, float) 
     33        self.XNAME = nappy.utils.text_parser.readItemsFromLines(self._readLines(self.NIV), self.NIV, str) 
    3434        self._readVariablesHeaderSection() 
    3535        self._readAuxVariablesHeaderSection() 
     
    6767        """ 
    6868        # Start with independent and Auxilliary vars 
    69         (x2_and_a, rtlines) = utils.text_parser.readItemsFromUnknownLines(datalines, 1 + self.NAUXV, float) 
     69        (x2_and_a, rtlines) = nappy.utils.text_parser.readItemsFromUnknownLines(datalines, 1 + self.NAUXV, float) 
    7070        (x, aux) = (x2_and_a[0], x2_and_a[1:]) 
    7171        self.X.append(x) 
     
    8282        """         
    8383        # Now get the dependent variables 
    84         (v, rtlines) = utils.text_parser.readItemsFromUnknownLines(datalines, self.NV, float)               
     84        (v, rtlines) = nappy.utils.text_parser.readItemsFromUnknownLines(datalines, self.NV, float)               
    8585                                         
    8686        count = 0 
  • nappy/trunk/nappy/nc_interface/na_content_collector.py

    r3351 r3354  
    1313# Imports from python standard library 
    1414import sys 
    15 import os 
    1615import time 
    17 import string 
    1816import re 
    1917 
     
    566564                comptime = cdtime.s2c(start_date) 
    567565                first_day = comptime.add(self.na_dict["X"][0][0], getattr(cdtime, unit.capitalize())) 
    568                 self.na_dict["DATE"] = string.replace(str(first_day).split(" ")[0], "-", " ").split() 
     566                self.na_dict["DATE"] = str(first_day).split(" ")[0].replace("-", " ").split() 
    569567            except: 
    570568                msg = "Nappy Warning: Could not get the first date in the file. You will need to manually edit the output file." 
     
    575573            if not self.na_dict.has_key("DATE"): 
    576574                msg = "Nappy Warning: Could not get the first date in the file. You will need to manually edit the output file." 
    577             print msg 
    578             self.output_message.append(msg) 
    579                 self.na_dict["DATE"] = ("DATE", "NOT", "KNOWN") 
     575                print msg 
     576                self.output_message.append(msg) 
     577                self.na_dict["DATE"] = ("DATE", "NOT", "KNOWN") 
     578            else: 
     579                pass # i.e. use existing DATE 
    580580 
    581581        self.na_dict["IVOL"] = 1 
     
    583583        for key in header_items.keys(): 
    584584             self.na_dict[key] = header_items[key] 
    585         return 
Note: See TracChangeset for help on using the changeset viewer.