Changeset 3288 for TI02-CSML


Ignore:
Timestamp:
30/01/08 11:59:33 (11 years ago)
Author:
domlowe
Message:

more tidying of scanner

Location:
TI02-CSML/trunk/csml
Files:
3 edited

Legend:

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

    r3286 r3288  
    3434            self.directory=self.selection[0] 
    3535        else: 
     36            self.selection=None 
    3637            self.directory = directory # top level directory containing data files    
    37         self.selection 
    3838        self.csmlfeaturetype  = csmlft  
    3939        self.mapping = mapping  
     
    5656            #this is caused by an incorrect directory name 
    5757            print 'error: Cannot find a config file at this location.' 
    58             sys.exit() 
     58            raise SystemExit 
    5959        #self.addSecurity() 
    6060        self.createFeatureFileMap() 
  • TI02-CSML/trunk/csml/csmlscan.py

    r3286 r3288  
    9999    config = ConfigParser.ConfigParser() 
    100100    #Get command line arguments 
    101     print sys.argv 
     101    #if len(sys.argv) ==1: 
     102        #print 'No arguments passed to csmlscan. Run "csmlscan --help" for more info.' 
     103        #raise SystemExit 
    102104    if optargs: 
    103105        #if called as main(args) from another python module use these args, else use  
     
    107109            opts, args = getopt.getopt(sys.argv[1:], "c:d:i:a:f:xt:m:po:s:v:T:h", ["configfile=","directory=","id=","minaxes=", "csmlfeaturetype=", "exitafterconfig","timedimension=", "filemapping=",  "printscreen", "outputfile=", "spatialstorage=","valuestorage=","timestorage=","help"]) 
    108110    except getopt.error, msg: 
    109             print "Invalid options, use --help for help" 
    110             sys.exit() 
     111            print 'Invalid options, use "csmlscan --help" for help' 
     112            raise SystemExit 
    111113    hasConfig=False 
    112114    configTest=False 
     
    173175     
    174176    else: #no config file, get command line args 
    175         for o, v in opts: 
    176             print o,v 
    177177        for o, v in opts: 
    178178            if o in ("-d", "--directory"): 
     
    200200            elif o in ("-h", "--help"): 
    201201                print usage 
    202                 sys.exit()       
     202                raise SystemExit 
    203203        if args is not []: 
    204204            SELECTION=args 
     
    239239        if configTest==True: 
    240240            #don't actually start the scan 
    241             sys.exit() 
     241            print '\n Abandoning scan, remove "-x" flag to scan for real' 
     242            raise SystemExit 
    242243             
    243244             
     
    262263 
    263264 
    264  
    265  
    266  
    267  
    268  
    269  
    270  
    271  
  • TI02-CSML/trunk/csml/testfiles/gridseries/subset.py

    r3096 r3288  
    5555 
    5656    #csmlContainer.add(feature.subsetToGridSeries(outputdir,ncname='mygridseries.nc',**subsetDictionary)) 
    57 #csmlContainer.add(feature.subsetToGridSeries(outputdir,ncname='mygridseries.nc',latitude=(-90,90), longitude=(-180,180),time=('2804-12-01T00:00:00.0','2904-12-01T00:00:00.0'))) 
     57csmlContainer.add(feature.subsetToGridSeries(outputdir,ncname='mygridseries.nc',latitude=(-90,90), longitude=(-180,180),time=('2804-12-01T00:00:00.0','2904-12-01T00:00:00.0'))) 
    5858 
    5959#csmlContainer.add(feature.subsetToGridSeries(outputdir,ncname='mygridseries.nc',latitude=(60), longitude=(180),time=('2804-12-01T00:00:00.0','2904-12-01T00:00:00.0'))) 
Note: See TracChangeset for help on using the changeset viewer.