def finallyProcess(self, _edObject=None): """ Parses the labelit.screen log file and the generated MOSFLM script """ EDPluginExecProcessScript.finallyProcess(self, _edObject) self.DEBUG("EDPluginDistlSignalStrengthThinClientv1_1.finallyProcess") strLabelitDistlLog = self.readProcessLogFile() if (strLabelitDistlLog is None): strErrorMessage = "EDPluginDistlSignalStrengthThinClientv1_1.finallyProcess : Could not read the Labelit log file" self.error(strErrorMessage) self.addErrorMessage(strErrorMessage) self.setFailure() xsDataImageQualityIndicators = XSDataImageQualityIndicators() xsDataImageQualityIndicators.setImage(self.xsDataImage) elif strLabelitDistlLog == "": strLabelitDislErr = self.readProcessErrorLogFile() if "httplib.BadStatusLine" in strLabelitDislErr: strErrorMessage = "Cannot read image due to problem with file permission!" else: strErrorMessage = "Labelit thin client error message: " + strLabelitDislErr self.error(strErrorMessage) self.addErrorMessage(strErrorMessage) self.setFailure() xsDataImageQualityIndicators = XSDataImageQualityIndicators() xsDataImageQualityIndicators.setImage(self.xsDataImage) else: xsDataImageQualityIndicators = self.parseLabelitDistlOutput(strLabelitDistlLog) xsDataImageQualityIndicators.setImage(self.xsDataImage) xsDataResultDistlSignalStrength = XSDataResultDistlSignalStrength() xsDataResultDistlSignalStrength.setImageQualityIndicators(xsDataImageQualityIndicators) self.setDataOutput(xsDataResultDistlSignalStrength)
def finallyProcess(self, _edObject=None): """ Parses the labelit.screen log file and the generated MOSFLM script """ EDPluginExecProcessScript.finallyProcess(self, _edObject) self.DEBUG("EDPluginDistlSignalStrengthThinClientv1_1.finallyProcess") strLabelitDistlLog = self.readProcessLogFile() if (strLabelitDistlLog is None): strErrorMessage = "EDPluginDistlSignalStrengthThinClientv1_1.finallyProcess : Could not read the Labelit log file" self.error(strErrorMessage) self.addErrorMessage(strErrorMessage) self.setFailure() xsDataImageQualityIndicators = XSDataImageQualityIndicators() xsDataImageQualityIndicators.setImage(self.xsDataImage) elif strLabelitDistlLog == "": strLabelitDislErr = self.readProcessErrorLogFile() if "httplib.BadStatusLine" in strLabelitDislErr: strErrorMessage = "Cannot read image due to problem with file permission!" else: strErrorMessage = "Labelit thin client error message: " + strLabelitDislErr self.error(strErrorMessage) self.addErrorMessage(strErrorMessage) self.setFailure() xsDataImageQualityIndicators = XSDataImageQualityIndicators() xsDataImageQualityIndicators.setImage(self.xsDataImage) else: xsDataImageQualityIndicators = self.parseLabelitDistlOutput( strLabelitDistlLog) xsDataImageQualityIndicators.setImage(self.xsDataImage) xsDataResultDistlSignalStrength = XSDataResultDistlSignalStrength() xsDataResultDistlSignalStrength.setImageQualityIndicators( xsDataImageQualityIndicators) self.setDataOutput(xsDataResultDistlSignalStrength)
def testParseLabelitDistlOutput(self): """ This method test the parsing of the distl.signal_strength results in the log file. """ edPluginDistlSignalStrengthv1_1 = self.createPlugin() strPathToLabelitLogText = os.path.join(self.getPluginTestsDataHome(), "dstl.signal_strength.log") strLabelitLogText = self.readAndParseFile(strPathToLabelitLogText) xsDataImageQualityIndicators = edPluginDistlSignalStrengthv1_1.parseLabelitDistlOutput( strLabelitLogText) xmlInput1 = self.readAndParseFile(self.__strReferenceInputFile1) xsDataInputDistlSignalStrength = XSDataInputDistlSignalStrength.parseString( xmlInput1) xsDataImageQualityIndicators.setImage( xsDataInputDistlSignalStrength.getReferenceImage()) strResultDistlSignalStrengthFile = os.path.join( self.getPluginTestsDataHome(), "XSDataResultDistlSignalStrength_reference.xml") strResultDistlSignalStrength = self.readAndParseFile( strResultDistlSignalStrengthFile) xsDataResultDistlSignalStrength = XSDataResultDistlSignalStrength.parseString( strResultDistlSignalStrength) xsDataImageQualityIndicatorsReference = xsDataResultDistlSignalStrength.getImageQualityIndicators( ) EDAssert.equal(xsDataImageQualityIndicatorsReference.marshal(), xsDataImageQualityIndicators.marshal())
def postProcess(self, _edObject=None): """ Parses the labelit.screen log file and the generated MOSFLM script """ EDPluginExecProcessScript.postProcess(self, _edObject) self.DEBUG("EDPluginDistlSignalStrengthv1_1.postProcess") strLabelitDistlLog = self.readProcessLogFile() if (strLabelitDistlLog is None or strLabelitDistlLog.strip() == ""): strErrorMessage = "EDPluginDistlSignalStrengthv1_1.postProcess : Could not read the Labelit log file" self.error(strErrorMessage) self.addErrorMessage(strErrorMessage) self.setFailure() else: xsDataImageQualityIndicators = self.parseLabelitDistlOutput(strLabelitDistlLog) xsDataImageQualityIndicators.setImage(self.xsDataImage) xsDataResultDistlSignalStrength = XSDataResultDistlSignalStrength() xsDataResultDistlSignalStrength.setImageQualityIndicators(xsDataImageQualityIndicators) self.setDataOutput(xsDataResultDistlSignalStrength)
def testGenerateExecutiveSummary(self): """ This method tests the generateExecutiveSummary of the Labelit plugin. It contains no assert call so the contents of the executive summary is not tested. """ edPluginDistlSignalStrengthThinClientv1_1 = self.createPlugin() xmlInput1 = self.readAndParseFile(self.__strReferenceInputFile1) edPluginDistlSignalStrengthThinClientv1_1.setDataInput(xmlInput1) strResultDistlSignalStrengthFile = os.path.join(self.getPluginTestsDataHome(), "XSDataResultDistlSignalStrengthThinClient_reference.xml") strResultDistlSignalStrength = self.readAndParseFile(strResultDistlSignalStrengthFile) xsDataResultDistlSignalStrength = XSDataResultDistlSignalStrength.parseString(strResultDistlSignalStrength) edPluginDistlSignalStrengthThinClientv1_1.setDataOutput(xsDataResultDistlSignalStrength) edPluginDistlSignalStrengthThinClientv1_1.generateExecutiveSummary(edPluginDistlSignalStrengthThinClientv1_1)
def testParseLabelitDistlOutput(self): """ This method test the parsing of the distl.signal_strength results in the log file. """ edPluginDistlSignalStrengthThinClientv1_1 = self.createPlugin() strPathToLabelitLogText = os.path.join(self.getPluginTestsDataHome(), "phenix.distl_thin_client_v17_650.txt") strLabelitLogText = self.readAndParseFile(strPathToLabelitLogText) xsDataImageQualityIndicators = edPluginDistlSignalStrengthThinClientv1_1.parseLabelitDistlOutput(strLabelitLogText) xmlInput1 = self.readAndParseFile(self.__strReferenceInputFile1) xsDataInputDistlSignalStrength = XSDataInputDistlSignalStrength.parseString(xmlInput1) xsDataImageQualityIndicators.setImage(xsDataInputDistlSignalStrength.getReferenceImage()) strResultDistlSignalStrengthFile = os.path.join(self.getPluginTestsDataHome(), "XSDataResultDistlSignalStrengthThinClient_reference.xml") strResultDistlSignalStrength = self.readAndParseFile(strResultDistlSignalStrengthFile) xsDataResultDistlSignalStrength = XSDataResultDistlSignalStrength.parseString(strResultDistlSignalStrength) xsDataImageQualityIndicatorsReference = xsDataResultDistlSignalStrength.getImageQualityIndicators() EDAssert.equal(xsDataImageQualityIndicatorsReference.marshal(), xsDataImageQualityIndicators.marshal())
def testGenerateExecutiveSummary(self): """ This method tests the generateExecutiveSummary of the Labelit plugin. It contains no assert call so the contents of the executive summary is not tested. """ edPluginDistlSignalStrengthv1_1 = self.createPlugin() xmlInput1 = self.readAndParseFile(self.__strReferenceInputFile1) edPluginDistlSignalStrengthv1_1.setDataInput(xmlInput1) strResultDistlSignalStrengthFile = os.path.join( self.getPluginTestsDataHome(), "XSDataResultDistlSignalStrength_reference.xml") strResultDistlSignalStrength = self.readAndParseFile( strResultDistlSignalStrengthFile) xsDataResultDistlSignalStrength = XSDataResultDistlSignalStrength.parseString( strResultDistlSignalStrength) edPluginDistlSignalStrengthv1_1.setDataOutput( xsDataResultDistlSignalStrength) edPluginDistlSignalStrengthv1_1.generateExecutiveSummary( edPluginDistlSignalStrengthv1_1)
def __init__(self): EDPluginExecProcessScript.__init__(self) self.setXSDataInputClass(XSDataInputDistlSignalStrength) self.setDataOutput(XSDataResultDistlSignalStrength())
def __init__(self): EDPluginExecProcessScript.__init__(self) self.setXSDataInputClass(XSDataInputDistlSignalStrength) self.strHostName = "localhost" self.iPortNumber = self.DEFAULT_SERVER_PORT self.setDataOutput(XSDataResultDistlSignalStrength())