Changeset 33672
- Timestamp:
- Apr 3, 2012, 4:23:54 PM (14 years ago)
- File:
-
- 1 edited
-
trunk/ippToPsps/jython/batch.py (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippToPsps/jython/batch.py
r33557 r33672 10 10 import logging 11 11 from subprocess import call, PIPE, Popen 12 from java.lang import * 13 from java.sql import * 14 from xml.etree.ElementTree import ElementTree, Element, tostring 12 15 13 16 from scratchdb import ScratchDb … … 15 18 from ipptopspsdb import IppToPspsDb 16 19 from fits import Fits 17 18 from java.lang import *19 from java.sql import *20 from xml.etree.ElementTree import ElementTree, Element, tostring21 20 22 21 ''' … … 69 68 return 70 69 71 # if no fits file, and this is not an IN batch, then get out of here72 else:73 if batchType != "IN":74 logger.errorPair("Could not read FITS for id", "%d" % id)75 return76 77 70 self.scratchDb.setUseFullTables(self.useFullTables) 78 71 … … 306 299 return False 307 300 308 # only now can we report that the batch has successfully processed309 self.ippToPspsDb.updateProcessed(self.batchID, 1)310 311 301 # delete tar file and original directory 312 302 os.remove(tarPath) … … 420 410 self.logger.infoPair("Done. Imported", "%d tables" % count) 421 411 self.indexIppTables() 412 413 return True 422 414 423 415 ''' … … 519 511 520 512 if not self.everythingOK: 521 self.logger.error ("Aborting this batch due to (hopefully) previously reported errors")513 self.logger.errorPair("Aborting this batch", "could not initialize") 522 514 self.ippToPspsDb.updateProcessed(self.batchID, -1) 523 515 return 524 516 525 517 if not self.createEmptyPspsTables(): 526 self.logger.error ("Aborting this batch due to (hopefully) previously reported errors")518 self.logger.errorPair("Aborting this batch", "could not create empty PSPS tables") 527 519 self.ippToPspsDb.updateProcessed(self.batchID, -1) 528 520 return 529 521 530 self.importIppTables() 522 if not self.importIppTables(): 523 self.logger.errorPair("Aborting this batch", "could not import IPP tables") 524 self.ippToPspsDb.updateProcessed(self.batchID, -1) 525 return 526 531 527 if not self.populatePspsTables(): 532 528 self.logger.errorPair("Aborting this batch", "unable to populate PSPS tables") 533 529 self.ippToPspsDb.updateProcessed(self.batchID, -1) 534 else: 535 if not self.exportPspsTablesToFits(): 536 self.logger.errorPair("Aborting this batch", "unable to export tables to FITS file") 537 else: 538 if self.writeBatchManifest(): 539 if self.config.datastorePublishing: 540 # tar and zip ready for publication to datastore 541 if self.tarAndZip(): 542 # now publish to the datastore 543 tarballFile = Batch.getTarballFile(self.batchID) 544 Batch.publishToDatastore( 545 self.datastore, 546 self.batchID, 547 self.batchName, 548 self.subDir, 549 tarballFile) 530 return 531 532 if not self.exportPspsTablesToFits(): 533 self.logger.errorPair("Aborting this batch", "unable to export tables to FITS file") 534 self.ippToPspsDb.updateProcessed(self.batchID, -1) 535 return 536 537 if self.writeBatchManifest(): 538 if self.config.datastorePublishing: 539 540 # tar and zip ready for publication to datastore 541 if self.tarAndZip(): 542 543 # only now can we report that the batch has successfully processed 544 self.ippToPspsDb.updateProcessed(self.batchID, 1) 545 546 # now publish to the datastore 547 tarballFile = Batch.getTarballFile(self.batchID) 548 Batch.publishToDatastore( 549 self.datastore, 550 self.batchID, 551 self.batchName, 552 self.subDir, 553 tarballFile) 550 554 551 555 from datastore import Datastore
Note:
See TracChangeset
for help on using the changeset viewer.
