Changeset 3172


Ignore:
Timestamp:
02/01/08 17:30:13 (12 years ago)
Author:
selatham
Message:

change working directory early, so that finds pwds file.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI01-discovery/trunk/ingestAutomation/OAIBatch/oai_ingest.py

    r3168 r3172  
    7272    dbinfoname = sys.argv[2] 
    7373 
     74#Change os directory to that with the code in it. 
     75os.chdir('/usr/local/WSClients/OAIBatch') 
     76 
    7477# Other settings and constants 
    7578date_string = commands.getoutput ("date +'%y%m%d_%H%M'") 
     
    8083 
    8184#Xquery settings 
    82 #f='glue.config' 
    83 #c=ConfigParser.ConfigParser() 
    84 #c.read(f) 
    8585xq=ndgXqueries() 
    8686xmldb=ndg_eXist(db='glue.badc.rl.ac.uk') 
     
    201201if status !=0: 
    202202    sys.exit("Failed at copying config file stage") 
    203  
    204 #Change os directory to that with the code in it. 
    205 os.chdir('/usr/local/WSClients/OAIBatch') 
    206  
    207203 
    208204#Execute the script which processes/renames the files (changed 08/01/07 to get id from inside file) 
     
    263259   if status !=0: 
    264260       sys.exit("ERROR: Failed at clearing out DIF2MOLES area.") 
    265  
    266 # Then run the minimum moles creator for each discovery record 
    267 # Put records in ./DIF2MOLES with same filename 
    268 #filenames = os.listdir(outdir) 
    269 #for filename in filenames: 
    270 #        if filename.find('.xml') != -1: 
    271 #                    original_filename = outdir + "/" + filename 
    272 #                    ident=getID(original_filename) 
    273 #                    if NDG_dataProvider: 
    274 #                        newident=ident.replace(":","__") 
    275 #                        print "identifier is %s" %newident 
    276 #                        molesLocalID = newident.split("__",2)[2] 
    277 #                    else: 
    278 #                        molesLocalID = ident 
    279 #                    print "molesLocalID is %s" %molesLocalID 
    280 #                    commandline = "java -jar D2B/d2boneoff.jar repositoryID " +datacentre_namespace+" repositoryLocalID "+datacentre+" format "+ \ 
    281 #                    datacentre_format+" repository xmldb:exist://glue.badc.rl.ac.uk:8080/exist/xmlrpc userpw xxxxxx targetCollection /db/discovery/original/"+ \ 
    282 #                    datacentre_format+"/"+datacentre_namespace +" inputRecordID "+ ident+ " outputLocalID "+molesLocalID+ " > ./DIF2MOLES/"+filename 
    283 #                    print "Executing command to run d2boneoff.jar" 
    284 #                    status= os.system(commandline) 
    285 #                    if status==10: 
    286 #                        print "WARNING: couldn't find the record" 
    287 #                    elif status!=0: 
    288 #                        print "ERROR: couldn't create the minimum moles records" 
    289 #                        sys.exit 
    290 #There should be some records now 
    291 try: 
    292     os.stat("./DIF2MOLES") 
    293 except: 
    294     print "ERROR: couldn't create any minimum moles records for %s" %datacentre 
    295     sys.exit() 
    296261 
    297262# Then run the minimum moles creator for each discovery record 
     
    334299    f.close() 
    335300 
     301#There should be some records now 
     302try: 
     303    os.stat("./DIF2MOLES") 
     304except: 
     305    print "ERROR: couldn't create any minimum moles records for %s" %datacentre 
     306    sys.exit() 
     307 
    336308#Add keywords if necessary 
    337309if datacentre_groups == "": 
Note: See TracChangeset for help on using the changeset viewer.