Ignore:
Timestamp:
22/05/06 16:40:48 (13 years ago)
Author:
lawrence
Message:

Minor bug fixes to various browse code bits and bobs ...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI07-MOLES/trunk/StubB/XSLT/browse/portal/cgi/insecure.py

    r857 r976  
    3131                return 0,s 
    3232 
    33 def insecureGetDoc(uri,db='xmldb:exist://glue.badc.rl.ac.uk:8080/exist/xmlrpc', jar='./returnmoles.jar'): 
     33def insecureGetDoc(uri,db='glue.badc.rl.ac.uk', jar='./returnstubb.jar'): 
    3434        ''' Use Kevin's code to get the document from exist ''' 
    3535        #we assume the URI is of the form repository/localid 
    3636        #we don't use os.path.split, because this is os indpendent. 
     37        edb='xmldb:exist://%s:8080/exist/xmlrpc'%db 
    3738        try: 
    3839                repPath,localID=uri.split('/') 
    3940        except: 
    4041                return None 
    41         returnMolesJar=jarLoc(jar) 
    42         cmd='java -jar %s %s %s %s'%( 
    43         returnMolesJar,repPath,localID, db) 
    44         status,result=commands.getstatusoutput(cmd)#osCommand(cmd) 
     42        #we can hash all this up properly later ... 
     43        #this file should exist (for the moment) in the cgi directory ... 
     44        #I know that's not very tidy, but it doesn't matter for the moment ... 
     45        f=file('passwords.txt','r') 
     46        pw={} 
     47        for host in f.readlines(): 
     48            h=host.strip().split(' ') 
     49            pw[h[0]]=h[1],h[2] 
     50        #try: 
     51        returnMolesJar=jarLoc(jar) 
     52        cmd='java -jar %s repositoryID %s localID %s repository %s user %s userpw %s '%( 
     53               returnMolesJar,repPath,localID, edb, pw[db][0], pw[db][1]) 
     54        status,result=commands.getstatusoutput(cmd) 
     55        #except: 
     56        #    return None 
    4557        if status:  
    4658                return None 
     
    7688if __name__=="__main__": 
    7789        #d= insecureGetDoc('badc.nerc.ac.uk/dataent13',jar='../returnmoles.jar') 
    78         d= insecureGetDoc('badc.nerc.ac.uk/activity3',jar='../returnmoles.jar') 
     90        d= insecureGetDoc('badc.nerc.ac.uk/dataent1',db='gepidae.esc.rl.ac.uk', 
     91            jar='../returnstubb.jar') 
    7992        print d 
    8093        #print d 
Note: See TracChangeset for help on using the changeset viewer.