Ignore:
Timestamp:
18/03/09 17:14:21 (13 years ago)
Author:
cbyrom
Message:

Move VocabList? model to the VocabTermEditor? project, since this is
where it sits most comfortably. Adjust getList method of vocabserverclient to return its data in an elementtree instead of
VocabList? to avoid codebase pollution + move tests + update tests
to cope with loss of VocabList?.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ndgCommon/trunk/ndg/common/src/clients/http/vocabserverclient.py

    r5083 r5117  
    77from xml.etree import ElementTree as ET 
    88from generichttpclient import GenericHTTPClient 
    9 from ndg.common.src.models.vocablist import VocabList 
    109from ndg.common.src.models.ndgObject import ndgObject 
    1110from ndg.common.src.lib.utilities import httpify 
     
    7271        @raise SystemError if the service returns an error 
    7372        @raise IOError if an invalid listKey is provided 
    74         @return VocabList with all data loaded - or None, if nothing retrieved 
     73        @raise SystemError if returned doc features an error 
     74        @return ElementTree with all data loaded - or None, if nothing retrieved 
    7575        ''' 
    7676        logging.debug("Retrieving list info for key, '%s'" %listKey) 
     
    7878        doc = self.readURL(url) 
    7979        et = ET.fromstring(doc) 
    80          
    81         list = VocabList(et = et) 
     80        error = et.findtext('{%s}error' %ndgObject.VOCAB_NS) 
    8281         
    8382        # check for errors 
    84         if list.error != 'false': 
    85             raise SystemError("Problem occurred whilst looking up vocab data: %s" %list.error) 
     83        if error != 'false': 
     84            raise SystemError("Problem occurred whilst looking up vocab data: %s" %error) 
    8685         
    8786        logging.debug("- returning info in Elementtree object") 
    88         return list 
     87        return et 
    8988     
    9089     
Note: See TracChangeset for help on using the changeset viewer.