Ignore:
Timestamp:
19/06/07 10:34:19 (12 years ago)
Author:
spascoe
Message:

A cleaner way of implementing WCS "store" (hopefully).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI05-delivery/ows_framework/trunk/ows_server/ows_server/lib/csml_util.py

    r2603 r2606  
    4444       publish flag is used to indicate that the netcdf file should be made available to the webserver (for asynchronous delivery) 
    4545    """ 
    46     # Get temporary extract dir 
    47     extract_dir = request.environ['paste.config']['app_conf']['tmp_dir'] 
     46 
     47    if publish: 
     48        #if publishing to download directory is required, do so and return publishable file name 
     49        #used e.g. in WCS when "STORE = true" 
     50        publish_dir=request.environ['paste.config']['app_conf']['publish_dir'] 
     51    else: 
     52        extract_dir = request.environ['paste.config']['app_conf']['tmp_dir'] 
    4853     
    4954    # Subset the feature 
     
    5156    feature.subsetToGridSeries(ncname=os.path.basename(filename), 
    5257                               outputdir=os.path.dirname(filename) ,**sel) 
    53      
    54     #if publishing to download directory is required, do so and return publishable file name 
    55     #used e.g. in WCS when "STORE = true" 
    56     if publish !=False: 
    57         publish_dir=request.environ['paste.config']['app_conf']['publish_dir'] 
    58         #copy file from tmp_dir to publish directory 
    59         publishedName=publish_dir +'/'+os.path.basename(filename) 
    60         os.system ("cp %s %s" % (filename, publishedName)) 
    61         return publishedName 
     58 
    6259    return filename 
    6360         
Note: See TracChangeset for help on using the changeset viewer.