def postProcess(self, _edObject=None): """ Calls the parent preProcess method Checks that the installed 3rd party software is in the list of compatible versions """ EDPluginExecProcess.postProcess(self) self.DEBUG("EDPluginExecProcessScript.postProcess") # Tests the compatibles executable versions listCompatibleVersions = self.getListOfCompatibleVersions() if (len(listCompatibleVersions) != 0): bFound = False for compatibleVersion in listCompatibleVersions: bFound = self.findStringInLog(compatibleVersion) if (bFound == True): break if (bFound == False): strErrorMessage = "Plugin not compatible with %s, compatible versions are: %s" % ( self.getStringVersion(), self.getCompatibleVersionsStringLine()) self.error(strErrorMessage) self.addErrorMessage(strErrorMessage) self.setFailure() if self.isVerboseDebug(): raise RuntimeError(strErrorMessage)
def postProcess(self, _edObject=None): """ Calls the parent preProcess method Checks that the installed 3rd party software is in the list of compatible versions """ EDPluginExecProcess.postProcess(self) self.DEBUG("EDPluginExecProcessScript.postProcess") # Tests the compatibles executable versions listCompatibleVersions = self.getListOfCompatibleVersions() if(len(listCompatibleVersions) != 0): bFound = False for compatibleVersion in listCompatibleVersions: bFound = self.findStringInLog(compatibleVersion) if(bFound == True): break if(bFound == False): strErrorMessage = "Plugin not compatible with %s, compatible versions are: %s" % (self.getStringVersion(), self.getCompatibleVersionsStringLine()) self.error(strErrorMessage) self.addErrorMessage(strErrorMessage) self.setFailure() if self.isVerboseDebug(): raise RuntimeError, strErrorMessage
def postProcess(self, _edObject=None): """ postProcess of the plugin EDPluginSPDCorrectv10.py: - convert to HDF if needed (to be implemented) - move images (if needed) - set result XML """ EDPluginExecProcess.postProcess(self) self.DEBUG("EDPluginSPDCorrectv10.postProcess") EDUtilsPath.createFolder(self.dictGeometry["OutputDir"]) if self.getClassName() == "EDPluginSPDCorrectv10": strInputImagePathNoSfx = os.path.splitext(os.path.basename(self.pathToInputFile))[0] destFileBaseName = strInputImagePathNoSfx + self.dictGeometry["OutputFileType"] strOutputFilePath = os.path.join(self.dictGeometry["OutputDir"], destFileBaseName) if not self._bFireAndForget: if "corrected" in self.dictRes: strTempFilePath = self.dictRes["corrected"] else: strTempFilePath = os.path.join(self.getWorkingDirectory(), destFileBaseName) if self.dictGeometry["OutputFileType"].lower() in [".hdf5", ".nexus", ".h5", ".nx"]: self.WARNING("HDF5/Nexus output is not yet implemented in the SPD plugin.") if os.path.exists(strOutputFilePath): self.WARNING("Destination file exists, I will leave result file in %s." % strTempFilePath) strOutputFilePath = strTempFilePath else: shutil.move(strTempFilePath, strOutputFilePath) # # Create the output data xsDataFile = XSDataFile() xsDataFile.setPath(XSDataString(strOutputFilePath)) xsDataResultSPD = XSDataResultSPD() xsDataResultSPD.setCorrectedFile(xsDataFile) self.setDataOutput(xsDataResultSPD)
def postProcess(self, _edObject=None): """ postProcess of the plugin EDPluginSPDCorrectv10.py: - convert to HDF if needed (to be implemented) - move images (if needed) - set result XML """ EDPluginExecProcess.postProcess(self) self.DEBUG("EDPluginSPDCorrectv10.postProcess") EDUtilsPath.createFolder(self.dictGeometry["OutputDir"]) if self.getClassName() == "EDPluginSPDCorrectv10": strInputImagePathNoSfx = os.path.splitext( os.path.basename(self.pathToInputFile))[0] destFileBaseName = strInputImagePathNoSfx + self.dictGeometry[ "OutputFileType"] strOutputFilePath = os.path.join(self.dictGeometry["OutputDir"], destFileBaseName) if not self._bFireAndForget: if "corrected" in self.dictRes: strTempFilePath = self.dictRes["corrected"] else: strTempFilePath = os.path.join(self.getWorkingDirectory(), destFileBaseName) if self.dictGeometry["OutputFileType"].lower() in [ ".hdf5", ".nexus", ".h5", ".nx" ]: self.WARNING( "HDF5/Nexus output is not yet implemented in the SPD plugin." ) if os.path.exists(strOutputFilePath): self.WARNING( "Destination file exists, I will leave result file in %s." % strTempFilePath) strOutputFilePath = strTempFilePath else: shutil.move(strTempFilePath, strOutputFilePath) # # Create the output data xsDataFile = XSDataFile() xsDataFile.setPath(XSDataString(strOutputFilePath)) xsDataResultSPD = XSDataResultSPD() xsDataResultSPD.setCorrectedFile(xsDataFile) self.setDataOutput(xsDataResultSPD)