Ignore:
Timestamp:
27/05/09 10:08:55 (11 years ago)
Author:
domlowe
Message:

removing console log messages

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cowsclient/cowsclient/lib/wmc_util.py

    r5307 r5340  
    1010""" 
    1111from cowsclient.lib.base import * 
    12 #from ndgUtils.DocumentRetrieve import genericHTTP 
    13 #from ndgUtils.ETxmlView import loadET,et2text, nsdumb 
    1412from cowsclient.model.WMC import WMC 
    1513from cowsclient.lib import exceptions   
     
    1715import logging 
    1816log = logging.getLogger(__name__) 
     17 
    1918 
    2019def getConTerraDoc(wmcURLs): 
     
    5150    # retrieve context data from the specifiled url 
    5251    wmcDoc = RetrieveWebMapContext(self, self.inputs['ENDPOINT']) 
    53      
     52    log.info('WMC RESPONSE %s'%response) 
    5453    response.headers['Content-Type'] = 'text/xml' 
    5554    response.write(wmcDoc) 
     
    5756 
    5857def GetLegend(self): 
    59     """ 
    60     Lookup a legend for a WMS map 
    61     NB, all required parameters are already included in the endpoint by this stage 
    62     """ 
    63     endpoint = self.inputs['ENDPOINT'] 
    64     if not endpoint: 
    65         raise exceptions.MissingParameterValue, "ENDPOINT parameter required" 
    66     log.info('Getting Legend from endpoint: ' + endpoint) 
     58    #not implemented yet 
     59    return None 
    6760 
    68     try: 
    69         filehandle = urllib2.urlopen(endpoint) 
    70     except IOError: 
    71         raise exceptions.URLUnavailable, "Could not access WMS endpoint: %s" % endpoint 
    72          
    73     response.headers['Content-Type'] = 'text/xml' 
    74     response.write(filehandle.read()) 
     61#def GetLegend(self): 
     62#    """ 
     63#    Lookup a legend for a WMS map 
     64#    NB, all required parameters are already included in the endpoint by this stage 
     65#    """ 
     66#    endpoint = self.inputs['ENDPOINT'] 
     67#    if not endpoint: 
     68#        raise exceptions.MissingParameterValue, "ENDPOINT parameter required" 
     69#    log.info('Getting Legend from endpoint: ' + endpoint) 
     70#    try: 
     71#        req = urllib2.Request(endpoint,urllib.urlencode(request.params),{'Cookie': request.headers.get('Cookie', '')}) 
     72#        filehandle = urllib2.urlopen(req) 
     73#    except IOError: 
     74#        raise exceptions.URLUnavailable, "Could not access WMC endpoint: %s" % endpoint 
     75#    response.headers['Content-Type'] = 'text/xml' 
     76#    response.write(filehandle.read()) 
    7577     
    7678def RetrieveWebMapContext(self, endpoint): 
     
    8183    if not endpoint: 
    8284        raise exceptions.MissingParameterValue, "ENDPOINT parameter required" 
    83     log.info('Getting WebMapContext from endpoint: ' + endpoint) 
    84  
     85    log.info('Getting WebMapContext from endpoint: ' + endpoint)    
     86     
     87    #cookies are passed to enable authorisation mechanisms e.g. ndg security 
    8588    try: 
    86         filehandle = urllib2.urlopen(endpoint) 
     89        req = urllib2.Request(endpoint,urllib.urlencode(request.params),{'Cookie': request.headers.get('Cookie', '')}) 
     90        filehandle = urllib2.urlopen(req) 
    8791    except IOError: 
    8892        raise exceptions.URLUnavailable, "Could not access WMC endpoint: %s" % endpoint 
    89  
    9093    return filehandle.read() 
    9194         
Note: See TracChangeset for help on using the changeset viewer.