Changeset 4910 for cows


Ignore:
Timestamp:
09/02/09 14:04:02 (11 years ago)
Author:
spascoe
Message:

Changes for compatibility with WebHelpers? 0.6. (no longer using
webhelpers.rails or webhelpers.url_for).

Changes to paster config. See example below:

#set to pylons if you want WMS calls to be handled by the pylons 
debugger.
# Else WMS exceptions will be raised
cows.exception_type = pylons
# Point to the service-level OWS configuration file
cows.capabilities_config = ./capabilities.conf
cows.csml.tmpdir = /tmp
cows.csml.csmlstore = ./ndg3_test_data/csml
cows.csml.colourmap = jet
cows.csml.publish_dir = ./CowsServer/publish
cows.csml.wfsconfig = ./wfs.cfg
Location:
cows/trunk
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • cows/trunk/cows/builder.py

    r4751 r4910  
    88""" 
    99 
     10import os 
    1011import ConfigParser 
    1112from cStringIO import StringIO 
     
    123124 
    124125def loadConfigFile(filename): 
     126    if not os.path.exists(filename): 
     127        raise ValueError('Configuration %s does not exist' % filename) 
     128 
    125129    b = ServiceMetadataBuilder() 
    126130 
  • cows/trunk/cows/pylons/ows_controller.py

    r4906 r4910  
    1111from pylons.controllers import WSGIController 
    1212from pylons.templating import render 
    13 try:#pylons has changed the way ithis is imported in newer versions(0.9.7rc3) 
    14     from webhelpers import url_for 
    15 except: 
    16     from routes import url_for 
     13from routes import url_for 
    1714from paste.util.multidict import MultiDict 
    1815 
     
    2320from cows.qs_util import parse_qsl 
    2421from cows.model import * 
     22from cows.pylons.util import configCSML 
    2523 
    2624from genshi.template import TemplateLoader 
     
    4341# Configure 
    4442EXCEPTION_TYPE = config.get('cows.exception_type', 'ogc') 
    45  
     43configCSML() 
    4644 
    4745class OWSControllerBase(WSGIController): 
  • cows/trunk/cows/pylons/templates/wcs_capabilities_1_0_0.xml

    r4805 r4910  
    77from cows.pylons.genshi_util import RenameElementFilter 
    88from genshi import QName 
    9 import webhelpers as h 
    10  
    119?> 
    1210 
  • cows/trunk/cows/pylons/templates/wcs_describecoverage_1_0_0.xml

    r4774 r4910  
    44from cows.pylons.genshi_util import RenameElementFilter 
    55from genshi import QName 
    6 import webhelpers as h 
    76 
    87?> 
  • cows/trunk/cows/pylons/templates/wfs_capabilities_1_1_0.xml

    r4317 r4910  
    55from cows.pylons.genshi_util import RenameElementFilter 
    66from genshi import QName 
    7 import webhelpers as h 
     7from routes import url_for 
    88 
    99?> 
     
    6969               py:content="kw"/> 
    7070    </ows:Keywords> 
    71     <!--! <OnlineResource xlink:type="simple" xlink:href="${h.url_for(qualified=True, action='index')}?"/> --> 
     71    <!--! <OnlineResource xlink:type="simple" xlink:href="${url_for(qualified=True, action='index')}?"/> --> 
    7272    <ows:ServiceType>OGC:WFS</ows:ServiceType> 
    7373        <ows:ServiceTypeVersion>1.1.0</ows:ServiceTypeVersion> 
  • cows/trunk/cows/pylons/templates/wfs_capabilities_2_0_0.xml

    r4408 r4910  
    55from cows.pylons.genshi_util import RenameElementFilter 
    66from genshi import QName 
    7 import webhelpers as h 
     7from routes import url_for 
    88 
    99?> 
     
    7070               py:content="kw"/> 
    7171    </ows:Keywords> 
    72     <!--! <OnlineResource xlink:type="simple" xlink:href="${h.url_for(qualified=True, action='index')}?"/> --> 
     72    <!--! <OnlineResource xlink:type="simple" xlink:href="${url_for(qualified=True, action='index')}?"/> --> 
    7373    <ows:ServiceType>OGC:WFS</ows:ServiceType> 
    7474        <ows:ServiceTypeVersion>2.0.0</ows:ServiceTypeVersion> 
  • cows/trunk/cows/pylons/templates/wms_capabilities_1_1_1.xml

    r4032 r4910  
    77from cows.pylons.genshi_util import RenameElementFilter 
    88from genshi import QName 
    9 import webhelpers as h 
     9from routes import url_for 
    1010 
    1111?> 
     
    7575        <Format py:for="f in ds.legendFormats" py:content="f"/> 
    7676        <OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple"  
    77                         xlink:href="${h.url_for(qualified=True, action='index')}?request=GetLegend&amp;layers=${ds.identifier}"/> 
     77                        xlink:href="${url_for(qualified=True, action='index')}?request=GetLegend&amp;layers=${ds.identifier}"/> 
    7878      </LegendURL> 
    7979    </Style> 
     
    9494    </KeywordList> 
    9595    <OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple"  
    96                     xlink:href="${h.url_for(qualified=True, action='index')}?"/> 
     96                    xlink:href="${url_for(qualified=True, action='index')}?"/> 
    9797     
    9898    <ContactInformation py:if="sm.serviceProvider is not None" 
  • cows/trunk/cows/pylons/templates/wms_capabilities_1_3_0.xml

    r4107 r4910  
    55from cows.pylons.genshi_util import RenameElementFilter 
    66from genshi import QName 
    7 import webhelpers as h 
     7from routes import url_for 
    88 
    99?> 
     
    8181      <LegendURL width="${ds.legendSize[0]}" height="${ds.legendSize[1]}"> 
    8282        <Format py:for="f in ds.legendFormats" py:content="f"/> 
    83         <OnlineResource xlink:type="simple" xlink:href="${h.url_for(qualified=True, action='index')}?request=GetLegend&amp;layers=${ds.identifier}"/> 
     83        <OnlineResource xlink:type="simple" xlink:href="${url_for(qualified=True, action='index')}?request=GetLegend&amp;layers=${ds.identifier}"/> 
    8484      </LegendURL> 
    8585    </Style> 
     
    9999               py:content="kw"/> 
    100100    </KeywordList> 
    101     <OnlineResource xlink:type="simple" xlink:href="${h.url_for(qualified=True, action='index')}?"/> 
     101    <OnlineResource xlink:type="simple" xlink:href="${url_for(qualified=True, action='index')}?"/> 
    102102     
    103103    <ContactInformation py:if="sm.serviceProvider is not None" 
  • cows/trunk/cows/pylons/wfs_controller.py

    r4481 r4910  
    88from cStringIO import StringIO 
    99from sets import Set 
    10 from pylons import request, response, c, config 
     10from pylons import request, response, c 
    1111import ConfigParser 
    1212import xml.etree.ElementTree as etree 
     
    2222from cows.exceptions import * 
    2323from cows import bbox_util 
     24from cows.service.imps.csmlbackend.config import config 
    2425 
    2526class WFSController(ows_controller.OWSController): 
  • cows/trunk/cows/service/imps/csmlbackend/csmlcommon.py

    r4785 r4910  
    77import csml 
    88import tempfile 
    9 #!FIXME: modules in the service package shouldn't depend on pylons. 
    10 from pylons import config #config must have tmpfilebuffer and csmlstore values 
     9 
     10from cows.service.imps.csmlbackend.config import config 
     11 
    1112import ConfigParser 
    1213log = logging.getLogger(__name__) 
  • cows/trunk/cows/service/imps/csmlbackend/wcs_csmllayer.py

    r4774 r4910  
    99except: 
    1010    import cdms 
    11 from pylons import config, request, session 
    1211from copy import copy 
    1312 
  • cows/trunk/cows/service/imps/csmlbackend/wms_csmllayer.py

    r4897 r4910  
    99except: 
    1010    import cdms 
    11 from pylons import config, request, session 
     11from cows.service.imps.csmlbackend.config import config 
    1212import Image 
    1313from copy import copy 
     
    2121from cows.service.wms_iface import IwmsLayer, IwmsDimension, IwmsLayerSlab 
    2222from cows.service.imps.csmlbackend.csmlcommon import CSMLLayerMapper, CSMLConnector 
    23  
    2423 
    2524 
     
    160159        if type(self._feature) == csml.parser.GridSeriesFeature: 
    161160            randomname= csml.csmllibs.csmlextra.getRandomID() + '.nc' 
    162             result= self._feature.subsetToGridSeries(config['tmpfilebuffer'], ncname=randomname, **dimValues) 
     161            result= self._feature.subsetToGridSeries(config['tmpdir'], ncname=randomname, **dimValues) 
    163162            #for now have to read netcdf back from  
    164163            #disk (limitiation of CSML api) 
     
    212211            log.debug('not calling cache') 
    213212            randomname= csml.csmllibs.csmlextra.getRandomID() + '.nc' 
    214             result= self._feature.subsetToGridSeries(config['tmpfilebuffer'], ncname=randomname, **dimValues) 
     213            result= self._feature.subsetToGridSeries(config['tmpdir'], ncname=randomname, **dimValues) 
    215214            #for now have to read netcdf back from disk (limitation of CSML api) 
    216215            f=cdms.open(result[1]) 
     
    328327        log.debug('getImage(%s, %s, %s)' % (bbox, width, height)) 
    329328         
    330  
    331         cmap=eval(config['colourmap']) # renderOpts is hook for colourmap, for now use config 
     329        cmap = cm.get_cmap(config['colourmap']) 
     330 
    332331        grid=Grid(self.layer, self._netcdf, bbox, width, height) 
    333332        #how to handle varmin,varmax? ..read array? 
  • cows/trunk/setup.py

    r4618 r4910  
    99    author_email='S.Pascoe@rl.ac.uk', 
    1010    url='http://proj.badc.rl.ac.uk/ndg/wiki/OwsFramework', 
    11      
     11 
     12    # We only list dependencies that we are confident will easy_install without 
     13    # a hitch here. 
     14    find_links=['http://ndg.nerc.ac.uk/dist'], 
     15    install_requires=['Pylons==0.9.6.1', 'csml'], 
     16 
    1217    classifiers=[ 
    1318    'Development Status :: 4 - Beta', 
Note: See TracChangeset for help on using the changeset viewer.