Changeset 32138 for trunk/ippToPsps/jython/batch.py
- Timestamp:
- Aug 19, 2011, 11:44:37 AM (15 years ago)
- File:
-
- 1 edited
-
trunk/ippToPsps/jython/batch.py (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippToPsps/jython/batch.py
r32118 r32138 64 64 self.survey = self.doc.find("options/survey").text 65 65 self.pspsSurvey = self.doc.find("options/pspsSurvey").text 66 dvoGpc1Label = self.doc.find("dvo/gpc1Label").text66 self.dvoGpc1Label = self.doc.find("dvo/gpc1Label").text 67 67 self.dvoLocation = self.doc.find("dvo/location").text 68 68 self.useFullTables = int(self.doc.find("dvo/useFullTables").text) … … 78 78 else: 79 79 self.surveyID = -1; 80 81 80 82 81 # get some options from the config … … 92 91 self.id, 93 92 self.survey, 94 dvoGpc1Label,93 self.dvoGpc1Label, 95 94 self.datastore.product) 96 95 97 96 # get local storage location from config 98 97 self.batchName = Batch.getNameFromID(self.batchID) 99 basePath = self.doc.find("localOutPath").text98 self.basePath = self.doc.find("localOutPath").text 100 99 self.subDir = Batch.getSubDir( 101 basePath,100 self.basePath, 102 101 self.batchType, 103 dvoGpc1Label)102 self.dvoGpc1Label) 104 103 105 104 self.localOutPath = Batch.getOutputPath( 106 basePath,105 self.basePath, 107 106 self.batchType, 108 dvoGpc1Label,107 self.dvoGpc1Label, 109 108 self.batchID) 110 109 … … 155 154 def getOutputPath(basePath, batchType, dvoLabel, id): 156 155 return Batch.getSubDir(basePath, batchType, dvoLabel) + "/" + Batch.getNameFromID(id) 156 157 ''' 158 Static method to get name of tar file 159 ''' 160 @staticmethod 161 def getTarFile(id): 162 return Batch.getNameFromID(id) + ".tar" 163 164 ''' 165 Static method to get path of tar file 166 ''' 167 @staticmethod 168 def getTarPath(basePath, batchType, dvoLabel, id): 169 return Batch.getSubDir(basePath, batchType, dvoLabel) + "/" + Batch.getTarFile(id) 170 171 ''' 172 Static method to get name of tarball file 173 ''' 174 @staticmethod 175 def getTarballFile(id): 176 return Batch.getTarFile(id) + ".gz" 177 178 ''' 179 Static method to get path of tarball file 180 ''' 181 @staticmethod 182 def getTarballPath(basePath, batchType, dvoLabel, id): 183 return Batch.getSubDir(basePath, batchType, dvoLabel) + "/" + Batch.getTarballFile(id) 184 185 ''' 186 Static method to delete this batch from local disk 187 ''' 188 @staticmethod 189 def deleteFromDisk(basePath, batchType, dvoLabel, id): 190 191 tarballPath = Batch.getTarballPath(basePath, batchType, dvoLabel, id) 192 dirPath = Batch.getOutputPath(basePath, batchType, dvoLabel, id) 193 194 if not os.path.exists(tarballPath): return 1 195 196 try: 197 os.remove(tarballPath) 198 except: 199 return 0 200 201 return 1 157 202 158 203 ''' … … 243 288 244 289 # set up filenams and paths 245 tarFile = self.batchName + ".tar" 246 tarPath = self.subDir + "/" + tarFile 247 248 tarballFile = tarFile + ".gz" 249 tarballPath = self.subDir + "/" + tarballFile 290 tarFile = Batch.getTarFile(self.batchID) 291 tarPath = Batch.getTarPath(self.basePath, self.batchType, self.dvoGpc1Label, self.batchID) 292 tarballFile = Batch.getTarballFile(self.batchID) 293 tarballPath = Batch.getTarballPath(self.basePath, self.batchType, self.dvoGpc1Label, self.batchID) 250 294 251 295 # tar directory … … 293 337 rs.close() 294 338 295 self.ippToPspsDb.update MinMaxObjID(self.batchID, self.minObjID, self.maxObjID)339 self.ippToPspsDb.updateDetectionStats(self.batchID, self.minObjID, self.maxObjID, self.totalDetections) 296 340 self.logger.infoPair("Total detections", "%ld" % self.totalDetections) 297 341 self.logger.infoPair("Min objID", "%ld" % self.minObjID)
Note:
See TracChangeset
for help on using the changeset viewer.
