Changeset 7342 for cows


Ignore:
Timestamp:
18/08/10 16:55:16 (9 years ago)
Author:
spascoe
Message:

New branch for migration to Python-2.6 and Pylons-1.0.

Location:
cows/branches/migrate-py26-pylons10
Files:
14 edited
1 copied

Legend:

Unmodified
Added
Removed
  • cows/branches/migrate-py26-pylons10/cows/pylons/config.py

    r6422 r7342  
    2929 
    3030 
    31 def configCSML(): 
     31def configCSML(app_config=None): 
    3232    """Initialise the configuration of the CSML backend from pylons.config. 
     33 
     34    For Pylons>=1.0 the pylons.config object is passed in explicitly. 
     35    If app_config=None Pylons-0.9.6.1 behaviour is assumed. 
    3336 
    3437    """ 
    3538     
    36     for k in pylons.config: 
     39    if app_config is None: 
     40        app_config = pylons.config 
     41 
     42    for k in app_config: 
    3743        parts = k.split('.') 
    3844        if parts[:2] == ['cows', 'csml']: 
    3945            k2 = '.'.join(parts[2:]) 
    40             config[k2] = pylons.config[k] 
     46            config[k2] = app_config[k] 
    4147     
    4248    #set up the CSML symlink checker to check all symlinks in the csmlstore 
  • cows/branches/migrate-py26-pylons10/cows/pylons/ows_controller.py

    r5284 r7342  
    1515 
    1616 
    17 from pylons import request, response, config, c 
     17from pylons import request, response, config, url 
     18from pylons import tmpl_context as c 
    1819from pylons.controllers import WSGIController 
    19 from pylons.templating import render 
    20 from routes import url_for 
     20from pylons.templating import render_genshi as render 
    2121from paste.util.multidict import MultiDict 
    2222 
     
    170170def addOperation(opName, formats=[]): 
    171171    ops = c.capabilities.operationsMetadata.operationDict 
    172     ops[opName] = helpers.operation(url_for(qualified=True, action="index")+'?', formats=formats) 
     172    ops[opName] = helpers.operation(url.current(qualified=True, action="index")+'?', formats=formats) 
    173173 
    174174def addLayer(name, title, abstract, srss, bbox, dimensions={}): 
  • cows/branches/migrate-py26-pylons10/cows/pylons/templates/catalogue.xml

    r5763 r7342  
    44 
    55from genshi import QName 
    6 from routes import url_for 
    7 from pylons import config,request        
     6from pylons import config,request, url 
    87if 'cows.cowsclienturl' in config: 
    98        cowsclient = True 
     
    3534        <ul  py:for="fc in allwxs"> 
    3635      <li py:if="cowsclient==True">${fc} 
    37         [<a href="${url_for(controller='csmlwms', fileoruri=fc, id=None, 
     36        [<a href="${url(controller='csmlwms', fileoruri=fc, id=None, 
    3837                            request='GetCapabilities', service='WMS')}" 
    3938                            >WMS</a>] 
    40             [<a href="${url_for(controller='csmlwcs', fileoruri=fc, id=None, 
     39            [<a href="${url(controller='csmlwcs', fileoruri=fc, id=None, 
    4140                            request='GetCapabilities', service='WCS')}" 
    4241                            >WCS</a>] 
    43             [<a href="${url_for(controller='csmlwfs', fileoruri=fc, id=None,  
     42            [<a href="${url(controller='csmlwfs', fileoruri=fc, id=None,  
    4443                            request='GetCapabilities', service='WFS')}" 
    4544                            >WFS</a>] 
    46         [<a href="${url_for(cowsclienturl) + 'ENDPOINT=' + serverurl +url_for(controller='csmlwms', fileoruri=fc, id=None)}" 
     45        [<a href="${url(cowsclienturl) + 'ENDPOINT=' + serverurl +url(controller='csmlwms', fileoruri=fc, id=None)}" 
    4746                            >Visualize</a>] 
    4847      </li> 
    4948          <li py:if="cowsclient!=True">${fc} 
    50         [<a href="${url_for(controller='csmlwms', fileoruri=fc, id=None, 
     49        [<a href="${url(controller='csmlwms', fileoruri=fc, id=None, 
    5150                            request='GetCapabilities', service='WMS')}" 
    5251                            >WMS</a>] 
    53             [<a href="${url_for(controller='csmlwcs', fileoruri=fc, id=None, 
     52            [<a href="${url(controller='csmlwcs', fileoruri=fc, id=None, 
    5453                            request='GetCapabilities', service='WCS')}" 
    5554                            >WCS</a>] 
    56             [<a href="${url_for(controller='csmlwfs', fileoruri=fc, id=None,  
     55            [<a href="${url(controller='csmlwfs', fileoruri=fc, id=None,  
    5756                            request='GetCapabilities', service='WFS')}" 
    5857                            >WFS</a>] 
    59             [<a href="${url_for(controller='demo', fileoruri=fc)}" 
     58            [<a href="${url(controller='demo', fileoruri=fc)}" 
    6059                            >Demo</a>] 
    6160      </li>      
     
    6362        <ul  py:for="fc in wfsonly"> 
    6463      <li >${fc} 
    65             [<a href="${url_for(controller='csmlwfs', fileoruri=fc, id=None,  
     64            [<a href="${url(controller='csmlwfs', fileoruri=fc, id=None,  
    6665                            request='GetCapabilities', service='WFS')}" 
    6766                            >WFS</a>] 
  • cows/branches/migrate-py26-pylons10/cows/pylons/templates/wfs_capabilities_1_1_0.xml

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

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

    r6520 r7342  
    77from cows.pylons.genshi_util import RenameElementFilter 
    88from genshi import QName 
    9 from routes import url_for 
     9from pylons import url 
    1010 
    1111?> 
     
    132132                            <Format py:for="f in ds.legendFormats" py:content="f"/> 
    133133                            <OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple"  
    134                                 xlink:href="${url_for(qualified=True, action='index')}?request=GetLegend&amp;layers=${ds.identifier}"/> 
     134                                xlink:href="${url.current(qualified=True, action='index')}?request=GetLegend&amp;layers=${ds.identifier}"/> 
    135135                    </LegendURL> 
    136136                </Style> 
     
    170170    </KeywordList> 
    171171    <OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple"  
    172                     xlink:href="${url_for(qualified=True, action='index')}?"/> 
     172                    xlink:href="${url.current(qualified=True, action='index')}?"/> 
    173173     
    174174    <ContactInformation py:if="sm.serviceProvider is not None" 
  • cows/branches/migrate-py26-pylons10/cows/pylons/templates/wms_capabilities_1_3_0.xml

    r6393 r7342  
    55from cows.pylons.genshi_util import RenameElementFilter 
    66from genshi import QName 
    7 from routes import url_for 
     7from pylons import url 
    88 
    99?> 
     
    138138                        <LegendURL width="${ds.legendSize[0]}" height="${ds.legendSize[1]}"> 
    139139                            <Format py:for="f in ds.legendFormats" py:content="f"/> 
    140                             <OnlineResource xlink:type="simple" xlink:href="${url_for(qualified=True, action='index')}?request=GetLegend&amp;layers=${ds.identifier}"/> 
     140                            <OnlineResource xlink:type="simple" xlink:href="${url.current(qualified=True, action='index')}?request=GetLegend&amp;layers=${ds.identifier}"/> 
    141141                        </LegendURL> 
    142142                    </Style> 
     
    175175           py:content="kw"/> 
    176176    </KeywordList> 
    177     <OnlineResource xlink:type="simple" xlink:href="${url_for(qualified=True, action='index')}?"/> 
     177    <OnlineResource xlink:type="simple" xlink:href="${url.current(qualified=True, action='index')}?"/> 
    178178     
    179179    <ContactInformation py:if="sm.serviceProvider is not None" 
  • cows/branches/migrate-py26-pylons10/cows/pylons/templates/wms_context_1_1_1.xml

    r5173 r7342  
    55from cows.pylons.genshi_util import RenameElementFilter 
    66from genshi import QName 
    7 from routes import url_for 
     7from pylons import url 
    88 
    99?> 
     
    1515                     xsi:schemaLocation="http://www.opengis.net/context http://schemas.opengis.net/context/1.1.0/context.xsd" 
    1616                     version="1.1.0" 
    17                      id="url_for()"> 
     17                     id="url.current()"> 
    1818 
    1919  <!--!TODO: Queriable if GetFeatureInfo is present --> 
     
    2222    <Server service="OGC:WMS" version="1.1.1"> 
    2323      <OnlineResource xlink:type="simple" 
    24                       xlink:href="${url_for(qualified=True, action='index')}"/> 
     24                      xlink:href="${url.current(qualified=True, action='index')}"/> 
    2525    </Server> 
    2626    <Name py:content="ds.identifier"/> 
  • cows/branches/migrate-py26-pylons10/cows/pylons/wcs_controller.py

    r6398 r7342  
    1717from sets import Set 
    1818from matplotlib.cm import get_cmap 
    19 from pylons import request, response, c 
     19from pylons import request, response 
     20from pylons import tmpl_context as c 
    2021import paste 
    2122 
  • cows/branches/migrate-py26-pylons10/cows/pylons/wfs_controller.py

    r6129 r7342  
    1515from cStringIO import StringIO 
    1616from sets import Set 
    17 from pylons import request, response, c 
     17from pylons import request, response 
     18from pylons import tmpl_context as c 
    1819import ConfigParser 
    1920import xml.etree.ElementTree as etree 
  • cows/branches/migrate-py26-pylons10/cows/pylons/wms_controller.py

    r6520 r7342  
    1717from sets import Set 
    1818from matplotlib.cm import get_cmap 
    19 from pylons import request, response, c, config 
    20 from routes import url_for 
     19from pylons import request, response, config, url 
     20from pylons import tmpl_context as c 
    2121from routes.util import GenerationException 
    2222from string import upper 
     
    184184            try: 
    185185                version='1.0.0' #wcs version 
    186                 wcsbaseurl=url_for('wcsroute', fileoruri=c.fileoruri,qualified=True)+'?' 
     186                wcsbaseurl=url('wcsroute', fileoruri=c.fileoruri,qualified=True)+'?' 
    187187                dataURLs=[DataURL(format='WCS:CoverageDescription', onlineResource='%sService=WCS&Request=DescribeCoverage&Coverage=%s&Version=%s'%(wcsbaseurl, layer.name, version))] 
    188188            except GenerationException: 
    189                 log.info("dataURLs not populated: could not generate WCS url with url_for('wcsroute', filedoruri=%s,qualified=True)"%c.fileoruri) 
     189                log.info("dataURLs not populated: could not generate WCS url with url('wcsroute', filedoruri=%s,qualified=True)"%c.fileoruri) 
    190190                dataURLs=[] 
    191191        else: 
  • cows/branches/migrate-py26-pylons10/cows/pylons/wxs_fetchcontroller.py

    r5532 r7342  
    88import os, logging 
    99from pylons.controllers import WSGIController 
    10 from pylons import request, response, config, session, c 
     10from pylons import request, response, config, session 
     11from pylons import tmpl_context as c 
    1112 
    1213log=logging.getLogger(__name__) 
  • cows/branches/migrate-py26-pylons10/cows/service/imps/geoplot_wms_backend/geoplot_wms_layer.py

    r6576 r7342  
    2929from cows.xml.iso19115_subset import OnlineResource 
    3030 
    31 from routes import url_for 
     31from pylons import url 
    3232 
    3333from cows.service.imps.csmlbackend.wms.wms_csmllayer import CSMLwmsLayer 
     
    285285        """ 
    286286                 
    287         indexURL = url_for(qualified=True, action='index') 
     287        indexURL = url.current(qualified=True, action='index') 
    288288        return indexURL 
  • cows/branches/migrate-py26-pylons10/setup.py

    r6576 r7342  
    1919    # We only list dependencies that we are confident will easy_install without 
    2020    # a hitch here. 
    21     install_requires=['Pylons==0.9.6.1', 'genshi', 'numpy==1.3.0', 'cdat_lite', 'csml', 
     21    install_requires=['Pylons>=1.0', 'genshi', 'numpy==1.3.0', 'cdat_lite', 'csml', 
    2222                      'matplotlib>=0.98'], 
    2323    find_links=['http://ndg.nerc.ac.uk/dist'], 
Note: See TracChangeset for help on using the changeset viewer.