Ejemplo n.º 1
0
 def postProcess(self, _edObject=None):
     """
     Parses the labelit.screen log file and the generated MOSFLM script
     """
     EDPluginExecProcessScript.postProcess(self, _edObject)
     self.DEBUG("EDPluginLabelitv10.postProcess...")
     strLabelitLog = self.readProcessLogFile()
     if strLabelitLog is None:
         errorMessage = EDMessage.ERROR_EXECUTION_03 % (
             "EDPluginLabelitv10.postProcess",
             self.getClassName(),
             "Could not read the Labelit log file",
         )
         self.error(errorMessage)
         self.addErrorMessage(errorMessage)
     else:
         xsDataLabelitScreenOutput = self.parseLabelitScreenOutput(strLabelitLog)
         xsDataIntegerSelectedSolutionNumber = xsDataLabelitScreenOutput.getSelectedSolutionNumber()
         if xsDataIntegerSelectedSolutionNumber is None:
             errorMessage = EDMessage.ERROR_EXECUTION_03 % (
                 "EDPluginLabelitv10.postProcess",
                 self.getClassName(),
                 "No selected solution",
             )
             self.error(errorMessage)
             self.addErrorMessage(errorMessage)
         else:
             strLabelitMosflmScriptsOutput = self.readProcessFile(
                 self.generateMosflmScriptName(xsDataIntegerSelectedSolutionNumber.getValue())
             )
             xsDataLabelitMosflmScriptsOutput = self.parseMosflmScriptsOutput(strLabelitMosflmScriptsOutput)
             xsDataResultLabelit = XSDataResultLabelit()
             xsDataResultLabelit.setLabelitScreenOutput(xsDataLabelitScreenOutput)
             xsDataResultLabelit.setLabelitMosflmScriptsOutput(xsDataLabelitMosflmScriptsOutput)
             self.setDataOutput(xsDataResultLabelit)
Ejemplo n.º 2
0
 def postProcess(self, _edObject=None):
     """
     Parses the labelit.screen log file and the generated MOSFLM script
     """
     EDPluginExecProcessScript.postProcess(self, _edObject)
     self.DEBUG("EDPluginLabelitv10.postProcess...")
     strLabelitLog = self.readProcessLogFile()
     if (strLabelitLog is None):
         errorMessage = EDMessage.ERROR_EXECUTION_03 % ("EDPluginLabelitv10.postProcess", self.getClassName(), "Could not read the Labelit log file")
         self.error(errorMessage)
         self.addErrorMessage(errorMessage)
     else:
         xsDataLabelitScreenOutput = self.parseLabelitScreenOutput(strLabelitLog)
         xsDataIntegerSelectedSolutionNumber = xsDataLabelitScreenOutput.getSelectedSolutionNumber()
         if (xsDataIntegerSelectedSolutionNumber is None):
             errorMessage = EDMessage.ERROR_EXECUTION_03 % ("EDPluginLabelitv10.postProcess", self.getClassName(), "No selected solution")
             self.error(errorMessage)
             self.addErrorMessage(errorMessage)
         else:
             strLabelitMosflmScriptsOutput = self.readProcessFile(self.generateMosflmScriptName(xsDataIntegerSelectedSolutionNumber.getValue()))
             xsDataLabelitMosflmScriptsOutput = self.parseMosflmScriptsOutput(strLabelitMosflmScriptsOutput)
             xsDataResultLabelit = XSDataResultLabelit()
             xsDataResultLabelit.setLabelitScreenOutput(xsDataLabelitScreenOutput)
             xsDataResultLabelit.setLabelitMosflmScriptsOutput(xsDataLabelitMosflmScriptsOutput)
             self.setDataOutput(xsDataResultLabelit)
 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.
     """
     edPluginLabelitv10 = self.createPlugin()
     xmlInput = self.readAndParseFile(self.strReferenceInputFile)
     edPluginLabelitv10.setDataInput(xmlInput)
     strPath = os.path.join(self.getPluginTestsDataHome(), self.strReferenceOutputFile)
     strXMLResultLabelit = self.readAndParseFile(strPath)
     from XSDataLabelitv10 import XSDataResultLabelit
     xsDataResultLabelit = XSDataResultLabelit.parseString(strXMLResultLabelit)
     edPluginLabelitv10.setDataOutput(xsDataResultLabelit)
     edPluginLabelitv10.generateExecutiveSummary(edPluginLabelitv10)
Ejemplo n.º 4
0
 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.
     """
     edPluginLabelitv10 = self.createPlugin()
     xmlInput = self.readAndParseFile(self.strReferenceInputFile)
     edPluginLabelitv10.setDataInput(xmlInput)
     strPath = os.path.join(self.getPluginTestsDataHome(),
                            self.strReferenceOutputFile)
     strXMLResultLabelit = self.readAndParseFile(strPath)
     from XSDataLabelitv10 import XSDataResultLabelit
     xsDataResultLabelit = XSDataResultLabelit.parseString(
         strXMLResultLabelit)
     edPluginLabelitv10.setDataOutput(xsDataResultLabelit)
     edPluginLabelitv10.generateExecutiveSummary(edPluginLabelitv10)
 def testGenerateXSDataIndexingResult(self):
     """
     This method tests the generation of an XSDataIndexingResult object given an XSDataResultLabelit object.
     """
     strPath = os.path.join(self.strDataPath, self.strReferenceOutputFile)
     strXMLResultLabelit = EDUtilsTest.readAndParseFile(strPath)
     EDFactoryPluginStatic.loadModule("XSDataLabelitv10")
     from XSDataLabelitv10 import XSDataResultLabelit
     xsDataResultLabelit = XSDataResultLabelit.parseString(strXMLResultLabelit)
     from EDHandlerXSDataLabelitv10 import EDHandlerXSDataLabelitv10
     xsDataIndexingResult = EDHandlerXSDataLabelitv10.generateXSDataIndexingResult(xsDataResultLabelit)
     strReferencePath = os.path.join(self.strDataPath, "XSDataIndexingResult_reference.xml")
     strIndexingResultReferenceXML = EDUtilsTest.readAndParseFile(strReferencePath)
     from XSDataMXv1 import XSDataIndexingResult
     xsDataIndexingResultReference = XSDataIndexingResult.parseString(strIndexingResultReferenceXML)
     EDAssert.equal(xsDataIndexingResultReference.marshal(), xsDataIndexingResult.marshal())