IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 32467


Ignore:
Timestamp:
Sep 29, 2011, 3:31:08 PM (15 years ago)
Author:
rhenders
Message:

now does not create a new batchID itself, but has one passed-in to the constructor; now does not update the ipptopsps database when publishing to datastore as this is now done in the Datastore class itself.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippToPsps/jython/batch.py

    r32332 r32467  
    3939                 ippToPspsDb,
    4040                 id,
     41                 batchID,
    4142                 batchType,
    4243                 fits):
     
    6061        # set up class variables
    6162        self.id = id
     63        self.batchID = batchID
    6264        self.gpc1Db = gpc1Db
    6365        self.ippToPspsDb = ippToPspsDb
     
    8890
    8991        # create datastore object
    90         self.datastore = Datastore(self.logger, self.doc)
     92        self.datastore = Datastore(self.logger, self.doc, self.ippToPspsDb)
    9193
    9294        # create a new batch
    93         self.batchID = self.ippToPspsDb.createNewBatch(
    94                 self.batchType,
    95                 self.id,
    96                 self.survey,
    97                 self.dvoGpc1Label,
    98                 self.datastore.product)
     95        #self.batchID = self.ippToPspsDb.createNewBatch(
     96        #       self.batchType,
     97        #        self.id,
     98        #        self.survey,
     99        #        self.dvoGpc1Label,
     100        #        self.datastore.product)
    99101
    100102        # get local storage location from config
     
    247249
    248250        outPath = self.localOutPath + "/BatchManifest.xml"
    249         tmpPath = "./tmp.xml"
     251        tmpPath = self.localOutPath + "/tmp.xml"
    250252        self.logger.infoPair("Creating manifest", outPath)
    251253        root = Element('manifest')
     
    316318
    317319        # now publish to the datastore
    318         Batch.publishToDatastore(self.datastore, self.ippToPspsDb, self.batchID, self.batchName, self.subDir, tarballFile)
     320        Batch.publishToDatastore(self.datastore, self.batchID, self.batchName, self.subDir, tarballFile)
    319321
    320322    '''
     
    322324    '''
    323325    @staticmethod
    324     def publishToDatastore(datastore, ippToPspsDb, batchID, batchName, subDir, tarballFile):
    325 
    326         if datastore.publish(batchName, subDir, tarballFile, "tgz"):
    327             ippToPspsDb.updateLoadedToDatastore(batchID, 1)
    328         else:
    329             ippToPspsDb.updateLoadedToDatastore(batchID, -1)
    330            
     326    def publishToDatastore(datastore, batchID, batchName, subDir, tarballFile):
     327        datastore.publish(batchName, subDir, tarballFile, "tgz")
    331328
    332329    '''
Note: See TracChangeset for help on using the changeset viewer.