Changeset 3043


Ignore:
Timestamp:
23/11/07 12:27:55 (12 years ago)
Author:
domlowe
Message:

more sensible error returned when file permissions or paths not set.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI02-CSML/trunk/csml/csmllibs/csmldataiface.py

    r3033 r3043  
    363363        self.extractType='cdunifExtract' 
    364364        self.extractPrefix = '_cdunifextract_' 
    365  
     365     
    366366    def openFile(self, filename): 
     367        self._filename=filename 
    367368        self.file=cdms.open(filename) 
    368  
     369         
    369370        #now we have the file name can properly determine extractType/Prefix 
    370371        fileExtension = str(filename)[-3:] 
     
    402403 
    403404    def setAxis(self,axis): 
     405        if not hasattr(self, 'file'): 
     406            raise Exception, 'Could not open/find underlying file: %s  -  If you are the system maintainer check file paths and permissions'%self._filename 
    404407        self.axisobj=self.file.getAxis(axis) 
    405408 
Note: See TracChangeset for help on using the changeset viewer.