source: TI01-discovery/trunk/ingestAutomation/OAIBatch/renderService.py @ 3785

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI01-discovery/trunk/ingestAutomation/OAIBatch/renderService.py@3785
Revision 3785, 621 bytes checked in by selatham, 11 years ago (diff)

gather required utilities. improve elementree imports in keywordAdder. put host etc in arguments for oai_ingest.

Line 
1class renderService:
2    def __init__(self,config):
3        self.config=config
4    def __call__(self,service):
5        if service.contentType not in ['NDG_A_Service','NDG_B_Service','DISCOVERY']:
6            section='RELATED'
7        else: section=service.contentType
8        icon=self.config.get(section,'icon')
9        alt=self.config.get(section,'icon_alt')
10        if service.description=='':
11            d=self.config.get(section,'title')
12        else: d=service.description
13        yield '<a href="%s" title="%s"><img src="%s" alt="%s"/></a>'%(
14                service.url,service.description,icon,alt)
Note: See TracBrowser for help on using the repository browser.