Ignore:
Timestamp:
19/03/07 14:37:25 (13 years ago)
Author:
lawrence
Message:

Cleaning up edge cases in discovery so that while NDG browse isn't
enabled, what you see still makes sense :-).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI07-MOLES/trunk/PythonCode/wsgi/DIF.py

    r2293 r2295  
    88from ETxmlView import loadET, nsdumb 
    99from renderEntity import renderEntity 
     10from ServiceBinding import DIFService 
    1011try: #python 2.5 
    1112    from xml.etree import ElementTree as ET 
     
    1819        from elementtree import ElementTree as ET 
    1920debug=1 
    20 class DIFService: 
    21     ''' A DIF only knows about a related URL ''' 
    22     def __init__(self,c,u,d): 
    23         ''' Take a related url tuple (content_type,url,description) and store it, using 
    24         an ndgModifier if necessary ''' 
    25         self.contentType,self.url,self.description=c,u,d 
    26     def __str__(self): 
    27         return '<a href="%s" title="%s">%s</a>'%self.contentType,self.url,self.description 
    2821     
    2922class DIF: 
     
    109102        #Data curator information 
    110103        self.centre=DIFcontact(helper.find(self.tree,'Data_Center'),ctype='centre',helper=helper) 
    111         self.curator=DIFcontact(self.tree) 
    112  
     104        self.curator=DIFcontact(helper.find(self.tree,'Data_Curator'),ctype='centre',helper=helper) 
     105        if self.curator is None:self.curator=self.centre  
     106        
    113107        #Data Creators 
    114108        self.creators=[] 
     
    128122            self.services.append( 
    129123                DIFService( 
    130                  helper.getText(item,'URL_Content_type'), 
     124                 helper.getText(item,'URL_Content_Type'), 
    131125                 helper.getText(item,'URL'), 
    132126                 helper.getText(item,'Description') )) 
Note: See TracChangeset for help on using the changeset viewer.