Ignore:
Timestamp:
07/06/06 14:06:32 (14 years ago)
Author:
domlowe
Message:

Some fixes to Parser and Scanner to enable scanning of GRIB files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI02-CSML/trunk/Scanner/csmllibs/csmldirectory.py

    r948 r1123  
    9999        fileExtension = str(filename)[-3:] 
    100100        supported = False 
    101         if fileExtension == '.nc': 
    102                 supported = True 
    103         elif fileExtension == '.pp': 
    104                 supported = True 
    105         elif fileExtension == 'ctl': 
    106                 supported = True 
    107         elif nappy.readFFI(filename) in [1001,1010,1020,2010,2110,2160,2310,3010,4010]: 
    108                 supported = True 
     101        try: 
     102            if fileExtension == '.nc': 
     103                    supported = True 
     104            elif fileExtension == '.pp': 
     105                    supported = True 
     106            elif fileExtension == 'ctl': 
     107                    supported = True 
     108            elif nappy.readFFI(filename) in [1001,1010,1020,2010,2110,2160,2310,3010,4010]: 
     109                    supported = True 
     110        except: 
     111                #the nappy.readFFI function can fail if permissions are wrong (for example) 
     112                supported=False 
    109113        return supported 
    110114                                 
Note: See TracChangeset for help on using the changeset viewer.