Ignore:
Timestamp:
18/02/08 16:10:03 (12 years ago)
Author:
spascoe
Message:

New facade to parts of the OWS common data model which will enable population from config file.

Location:
TI05-delivery/ows_framework/branches/ows_framework-refactor/ows_common/ows_common
Files:
2 added
3 edited
1 moved

Legend:

Unmodified
Added
Removed
  • TI05-delivery/ows_framework/branches/ows_framework-refactor/ows_common/ows_common/pylons/ows_controller.py

    r3408 r3450  
    135135    updateSequence = None 
    136136 
    137     def renderCapabilities(self, version, format): 
    138         """ 
    139         Override in subclases to render the capabilities document. 
    140         The response mime-type will already have been set. 
    141  
    142         @param version: the version as a sequence of numbers 
    143         @param format: the format as a string 
    144          
    145         @return: a template as expected by pylons.render() 
    146         """ 
    147         raise NotImplementedError 
    148137     
    149138    def GetCapabilities(self): 
     
    162151 
    163152        # Get information required for the capabilities document 
    164          
     153        self._loadCapabilities 
    165154         
    166155        # Render the capabilities document         
    167156        response.headers['content-type'] = format 
    168         return self.renderCapabilities(version, format) 
     157        return self._renderCapabilities(version, format) 
     158 
     159 
     160    def _renderCapabilities(self, version, format): 
     161        """ 
     162        Override in subclases to render the capabilities document. 
     163        The response mime-type will already have been set. 
     164 
     165        @param version: the version as a string 
     166        @param format: the format as a string 
    169167         
     168        @return: a template as expected by pylons.render() 
     169        """ 
     170        raise NotImplementedError 
    170171 
     172     
  • TI05-delivery/ows_framework/branches/ows_framework-refactor/ows_common/ows_common/util.py

    r3408 r3450  
    3434 
    3535def parse_version(version): 
     36    """ 
     37    Convert a version string into a tuple of integers suitable for doing 
     38    comparisons on. 
     39 
     40    """ 
    3641    return tuple(int(x) for x in version.split('.')) 
    3742 
     43def serialise_version(version): 
     44    """ 
     45    Convert a version tuple back to a string. 
     46 
     47    """ 
     48    return '.'.join(str(v) for v in version) 
     49 
    3850def negotiate_version(serverVersions, clientVersion=None): 
     51    """ 
     52    Negotiate which OWS version to use based on the version supplied by 
     53    the client and the list of supported versions. 
     54 
     55    """ 
    3956    versions = [parse_version(v) for v in serverVersions] 
    4057    versions.sort() 
     
    4865    for v in versions: 
    4966        if cv == v: 
    50             return v 
     67            return serialise_version(v) 
    5168        if cv < v: 
    52             return pv 
     69            return serialise_version(pv) 
    5370        pv = v 
    5471 
    55     return pv 
     72    return serialise_version(pv) 
    5673 
    5774 
     
    6380            raise OWS_E.InvalidUpdateSequence 
    6481     
     82 
    6583 
    6684#----------------------------------------------------------------------------- 
  • TI05-delivery/ows_framework/branches/ows_framework-refactor/ows_common/ows_common/wms.py

    r2591 r3450  
    114114    @ivar current 
    115115    @type current: boolean (default False) 
     116    @ivar unitSymbol: Unit symbol could probably be taken from the Domain 
     117        structure but it isn't clear where (the meaning or dataType 
     118        attributes?). 
     119    @type unitSymbol: str 
    116120 
    117121    """ 
    118122    def __init__(self, multipleValues=False, nearestValue=False, 
    119                  current=False, **kw): 
     123                 current=False, unitSymbol=None, **kw): 
    120124        super(Dimension, self).__init__(**kw) 
    121125         
     
    123127        self.nearestValue = nearestValue 
    124128        self.current = current 
    125  
     129        self.unitSymbol = unitSymbol 
    126130 
    127131# 
Note: See TracChangeset for help on using the changeset viewer.