Ignore:
Timestamp:
01/10/06 21:50:06 (15 years ago)
Author:
lawrence
Message:

Small refactoring of new discovery interface

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI07-MOLES/trunk/PythonCode/newDiscovery/testtemplate.py

    r1536 r1543  
    11import template 
     2from Utilities import myConfig 
     3from ndgSearch import ndgSearch 
    24 
    35def output(f,s): 
     
    68    ff.close() 
    79 
     10config=myConfig('config.test') 
     11print config.get('SEARCH','discoveryURL') 
    812 
    9 helpAddress="http://localhost:8000/discoveryHelp" 
    10 mainLogo="/layouts/logo" 
    11 discoveryURL="http://localhost:8000/cgi/advSearch" 
    12 advancedURL="http://localhost:8000/cgi/Search" 
     13inputs={} 
     14x=ndgSearch(inputs,config) 
     15print x.message 
     16output("main.html",x.html) 
    1317 
    14 main=template.main% locals() 
    15 advanced=template.advanced % locals() 
    16  
    17 # requires discoveryURL declared in parent, main defined here 
    18 mainForm=''' 
    19 <method="get" action="%s">%s</form> 
    20 '''%(discoveryURL,main) 
    21  
    22 advancedForm=''' 
    23 <method="get" action="%s">%s</form>'''%(advancedURL,advanced) 
    24  
    25 output("main.html",main) 
    26 output("advanced.html",advanced) 
     18inputs={'advanced':'1'} 
     19x=ndgSearch(inputs,config) 
     20print x.message 
     21output("advanced.html",x.html) 
    2722 
    2823 
Note: See TracChangeset for help on using the changeset viewer.