Ignore:
Timestamp:
15/02/08 18:46:46 (12 years ago)
Author:
astephen
Message:

Fixes to make NC to NA route work.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • nappy/trunk/nappy/nc_interface/cdms_to_na.py

    r3416 r3441  
    8888        # Make first call to collector class that creates NA dict from CDMS variables and global atts dicts 
    8989        collector = nappy.nc_interface.na_content_collector.NAContentCollector(variables, self.global_atts) 
    90         collected_dict = collector.collectNAContent() 
    91         # NOTE: collected_dict has attributes: na_dict, var_ids, unused_vars 
     90        collector.collectNAContent() 
    9291 
    9392        # Return if no files returned 
    94         if collected_dict.var_ids == None: 
     93        if collector.found_na == False: 
    9594            msg = "\nNo files created after variables parsed." 
    9695            if DEBUG: print msg 
    9796            self.output_message.append(msg) 
    98             return  
     97            return 
     98 
     99        # NOTE: collector has attributes: na_dict, var_ids, unused_vars 
    99100 
    100101        # Set up a list to collect multiple calls to content collector 
    101102        na_dict_list = [] 
    102         na_dict_list.append((collected_dict.na_dict, collected_dict.var_ids)) 
     103        na_dict_list.append((collector.na_dict, collector.var_ids)) 
    103104 
    104105        # If there are variables that were not captured (i.e. unused) by NAContentCollector then loop through these 
     
    106107        while len(collector.unused_vars) > 0: 
    107108            collector = nappy.nc_interface.na_content_collector.NAContentCollector(collector.unused_vars, self.global_atts) 
    108             collected_dict = collector.collectNAContent()            
     109            collector.collectNAContent()            
    109110            self.output_message += collector.output_message 
     111 
    110112            # Append to list if more variables were captured 
    111             if collector.var_ids != None:   
    112                 na_dict_list.append((collected_dict.na_dict, collected_dict.var_ids)) 
     113            if collector.found_na == True:   
     114                na_dict_list.append((collector.na_dict, collector.var_ids)) 
    113115 
    114116        self.na_dict_list = na_dict_list 
Note: See TracChangeset for help on using the changeset viewer.