Ignore:
Timestamp:
18/03/16 10:30:21 (4 years ago)
Author:
mjuckes
Message:

fixed bug in treatment of CMOR variables with no standard name

File:
1 edited

Legend:

Unmodified
Added
Removed
  • CCCC/trunk/ceda_cc/utils_c4.py

    r561 r616  
    11"""A set of classes running checks and providing utilities to support checks""" 
    2 import string, re, os, sys, traceback, ctypes 
     2import string, re, os, sys, traceback, ctypes, collections 
    33 
    44def strmm3( mm ): 
     
    616616 
    617617      if k == "standard_name": 
    618         if val.find( ' ' ) != -1: 
    619           val = string.join( string.split(val,maxsplit=1) ) 
    620         if targ.find( ' ' ) != -1: 
    621           targ = string.join( string.split(targ,maxsplit=1) ) 
     618        if val != None: 
     619          if val.find( ' ' ) != -1: 
     620            val = string.join( string.split(val,maxsplit=1) ) 
     621          if targ.find( ' ' ) != -1: 
     622            targ = string.join( string.split(targ,maxsplit=1) ) 
    622623 
    623624      if k == "cell_methods": 
     
    10041005     self.varInfo = {} 
    10051006     self.varcons = {} 
     1007     ##self.varcons = collections.defaultdict( dict ) 
    10061008     for f in tl: 
    10071009        vg = vgmap.get( f, f ) 
Note: See TracChangeset for help on using the changeset viewer.