Ignore:
Timestamp:
24/11/08 09:53:38 (12 years ago)
Author:
cbyrom
Message:

Add schemas to ndgXqueries object and add method to retrieve these + tidy up logic in a few other scripts.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • exist/trunk/python/ndgUtils/ndgObject.py

    r4430 r4483  
    106106 
    107107        # set default return format - if not set, just return in original format 
    108         fmt='' 
    109         if self.config.has_option('DISCOVERY','formatDefault'): 
    110             fmt=self.config.get('DISCOVERY','formatDefault') 
     108        fmt = self.config.get('DISCOVERY','formatDefault') 
     109        if fmt: 
    111110            logging.info("Default discovery format set to: %s" %fmt) 
    112111             
     
    120119        # config file should have details on the service to use for the repository 
    121120        # - if not, default to 'unknown' 
    122         servicehost = 'unknown' 
    123         if self.config.has_option('NDG_B_SERVICE',self.repository): 
    124             servicehost=self.config.get('NDG_B_SERVICE',self.repository) 
     121        servicehost = self.config.get('NDG_B_SERVICE',self.repository) 
     122        if not servicehost: 
     123            servicehost = 'unknown' 
    125124             
    126125        # If this record is itself a discovery record, then we don't have much more to do 
     
    130129            self.printableURL=self.__buildURL(discoveryBASE,[qs,('format','xml')]) 
    131130            self.URL=self.discoveryURL 
    132             if servicehost!='unknown':self.gettable=1 
     131            if servicehost != 'unknown': 
     132                self.gettable=1 
    133133        elif self.schema in self.BROWSE_SCHEMES: 
    134134            # One day we'll use a service binding to get this 
     
    141141            self.xmlURL=url.replace('/view/','/retrieve/')+'?format=raw' 
    142142            self.printableURL=url+'?format=xml' 
    143             if servicehost!='unknown': self.gettable=0 
     143            if servicehost !='unknown':  
     144                self.gettable=0 
    144145            self.useDiscoveryService = 0 
    145146        else: 
Note: See TracChangeset for help on using the changeset viewer.