Ignore:
Timestamp:
22/05/07 13:05:26 (12 years ago)
Author:
spascoe
Message:

Many new ideas in this commit. It's still in a state of flux.
I'm exploring using decorators and class attributes with the prefix "_ows"
to declare properties that need to be in the OWS capabilities document.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI05-delivery/ows_framework/trunk/ows_server/ows_server/controllers/csml_api.py

    r2494 r2501  
     1# Copyright (C) 2007 STFC & NERC (Science and Technology Facilities Council). 
     2# This software may be distributed under the terms of the 
     3# Q Public License, version 1.0 or later. 
     4# http://ndg.nerc.ac.uk/public_docs/QPublic_license.txt 
     5""" 
     6Basic CSML controller. 
     7 
     8@author: Stephen Pascoe 
     9""" 
     10 
    111from ows_server.lib.base import * 
    212import csml.parser 
    313import os 
     14from ows_server.lib.csml import get_csml_doc 
    415 
    5 def get_csml_doc(file): 
    6     """ 
    7     A trivial document retrieval function. 
    8  
    9     This could be replaced with a proper csml server object that supports 
    10     multiple stores (filesystem, exist) and cache's the results for 
    11     performance. 
    12  
    13     """ 
    14     csml_dir = request.environ['paste.config']['app_conf']['csml_dir'] 
    15     path = os.path.join(csml_dir, file) 
    16     if os.path.exists(path+'.csml'): 
    17         f = path+'.csml' 
    18     elif os.path.exists(path+'.xml'): 
    19         f = path +'.xml' 
    20     else: 
    21         raise ValueError("Cannot find CSML file %s" % file) 
    22      
    23     d = csml.parser.Dataset() 
    24     d.parse(f) 
    25          
    26     return d 
    2716 
    2817 
Note: See TracChangeset for help on using the changeset viewer.