Ignore:
Timestamp:
18/02/09 12:53:17 (11 years ago)
Author:
cbyrom
Message:

Adjust code to fit with changes to ndgCommon codebase + tidy up
structure of ndgInterface to make easier to follow + add documentation
+ add universal debug mode + various other small code tidy ups.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • MILK/trunk/milk_server/milk_server/controllers/browse/discovery.py

    r4979 r4992  
    66from ndg.common.src.clients.ws.discoveryserviceclient import DiscoveryServiceClient 
    77from ndg.common.src.clients.xmldb.eXist.searchclient import SearchClient 
    8 from ndg.common.src.dal.DocumentRetrieve import ndgVocabPOX as VS 
     8from ndg.common.src.clients.http.vocabserverclient import VocabServerClient as VS 
    99from ndg.common.src.models.ndgObject import ndgObject 
    1010from ndg.common.src.models.DIF import DIF 
     
    1414from milk_server.lib.mailer import mailHandler 
    1515 
    16 logging.basicConfig(level=logging.DEBUG, 
    17    format='%(asctime)s %(filename)s:%(lineno)d %(levelname)s %(message)s') 
    18  
    19 debug=0 
    20  
    2116class DiscoveryController(BaseController): 
    2217    ''' Provides the pylons controller for NDG discovery ''' 
     
    2520        ''' Common setup for controller methods ''' 
    2621        self.cf=request.environ['ndgConfig'] 
    27         self.exist=(self.cf.get('NDG_EXIST','local'),\ 
    28                     g.pwFile) 
     22        self.exist=(self.cf.get('NDG_EXIST','local'), g.pwFile) 
    2923        self.inputs=dict(parse_querystring(request.environ)) 
    3024        self.message='' 
     
    276270                 
    277271        except ValueError,e: 
    278             if debug:  
     272            if g.debugModeOn == 'True': 
    279273                raise ValueError,str(e) 
    280274            else: 
     
    348342    def semantic(self): 
    349343        self.__setup() 
    350         vs=VS(proxyServer=self.cf.get('DEFAULT','proxyServer')) 
     344        vs = VS(proxyServer=self.cf.get('DEFAULT','proxyServer')) 
    351345        if 'searchString' in self.inputs: 
    352346            try: 
    353                 [broader,narrower,synonyms]=vs.getRelated(self.inputs['searchString']) 
     347                [broader,narrower,synonyms] = vs.getRelated(self.inputs['searchString']) 
    354348                #get a base string for the links to new searches 
    355349                if 'start' in self.inputs: del self.inputs['start'] 
Note: See TracChangeset for help on using the changeset viewer.