当前位置: 首页>>代码示例>>Python>>正文


Python EDConfiguration.load方法代码示例

本文整理汇总了Python中EDConfiguration.EDConfiguration.load方法的典型用法代码示例。如果您正苦于以下问题:Python EDConfiguration.load方法的具体用法?Python EDConfiguration.load怎么用?Python EDConfiguration.load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在EDConfiguration.EDConfiguration的用法示例。


在下文中一共展示了EDConfiguration.load方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: testRasterConfiguration

# 需要导入模块: from EDConfiguration import EDConfiguration [as 别名]
# 或者: from EDConfiguration.EDConfiguration import load [as 别名]
 def testRasterConfiguration(self):
     strPathToTestConfigFile = os.path.join(self.strUnitTestDataHome, "XSConfiguration_raster.xml")
     edConfiguration = EDConfiguration(strPathToTestConfigFile)
     edConfiguration.load()
     xsPluginItem = edConfiguration.getPluginItem("EDPluginMOSFLMv10")
     xsDataMOSFLMInput = XSDataMOSFLMInput()
     xsDataMOSFLMBeam = XSDataMOSFLMBeamPosition()
     xsDataMOSFLMBeam.setX(XSDataLength(1.0))
     xsDataMOSFLMBeam.setY(XSDataLength(2.0))
     xsDataMOSFLMInput.setBeam(xsDataMOSFLMBeam)
     xsDataMOSFLMDetector = XSDataMOSFLMDetector()
     xsDataMOSFLMDetector.setType(XSDataString("ADSC"))
     xsDataMOSFLMInput.setDetector(xsDataMOSFLMDetector)
     xsDataMOSFLMInput.setDirectory(XSDataString("/tmp"))
     xsDataMOSFLMInput.setTemplate(XSDataString("testdata_1_###.img"))
     xsDataMOSFLMInput.setWavelength(XSDataWavelength(1.1111))
     xsDataMOSFLMInput.setDistance(XSDataLength(222.22))
     edPluginMOSFLMv10 = self.createPlugin()
     edPluginMOSFLMv10.setScriptExecutable("cat")
     edPluginMOSFLMv10.setConfiguration(xsPluginItem)
     edPluginMOSFLMv10.configure()
     edPluginMOSFLMv10.setXSDataInputClass(XSDataMOSFLMInput)
     edPluginMOSFLMv10.setDataInput(xsDataMOSFLMInput)
     edPluginMOSFLMv10.generateMOSFLMCommands()
     edListCommands = edPluginMOSFLMv10.getListCommandExecution()
     edListCommandsReference = ['WAVELENGTH 1.1111', 'DISTANCE 222.22', 'BEAM 1.0 2.0', 'DETECTOR ADSC', 'DIRECTORY /tmp', 'TEMPLATE testdata_1_###.img', 'RASTER 15 15 3 3 3']
     EDAssert.equal(edListCommandsReference, edListCommands, "MOSFLM commands with ratser configured")
开发者ID:olofsvensson,项目名称:edna-plugins-mx,代码行数:29,代码来源:EDTestCasePluginUnitMOSFLMv10.py

示例2: testSendEmail

# 需要导入模块: from EDConfiguration import EDConfiguration [as 别名]
# 或者: from EDConfiguration.EDConfiguration import load [as 别名]
 def testSendEmail(self):
     pluginMXCuBE = self.createPlugin()
     strPathToTestConfig = os.path.join(self.getPluginTestsDataHome(),
                                                     "XSConfiguration.xml")
     edConfiguration = EDConfiguration(strPathToTestConfig)
     edConfiguration.load()
     EDApplication.setConfiguration(edConfiguration)
     pluginMXCuBE.configure()
     pluginMXCuBE.sendEmail("EDTestCasePluginUnitControlInterfaceToMXCuBEv1_2sendEmail: Test subject", "EDTestCasePluginUnitControlInterfaceToMXCuBEv1_2sendEmail: Test message")
开发者ID:antolinos,项目名称:edna,代码行数:11,代码来源:EDTestCasePluginUnitControlInterfaceToMXCuBEv1_2sendEmail.py

示例3: getPluginConfiguration

# 需要导入模块: from EDConfiguration import EDConfiguration [as 别名]
# 或者: from EDConfiguration.EDConfiguration import load [as 别名]
 def getPluginConfiguration(self, _strConfigurationFileName):
     """
     Returns the plugin configuration from a configuration file
     """
     xsPluginItem = None
     edConfiguration = EDConfiguration(_strConfigurationFileName)
     if(edConfiguration != None):
         edConfiguration.load()
         xsPluginItem = edConfiguration.getPluginItem(self.getPluginName())
         if(xsPluginItem == None):
             EDVerbose.warning("EDTestCasePluginUnit.getPluginConfiguration: Could not get configuration plugin item for: " + self.getPluginName())
     else:
         EDVerbose.warning("EDTestCasePluginUnit.getPluginConfiguration: Could not load Configuration: " + _strConfigurationFileName)
     return xsPluginItem
开发者ID:olofsvensson,项目名称:edna-kernel,代码行数:16,代码来源:EDTestCasePluginUnit.py

示例4: testGenerateMOSFLMIntegrationCommands

# 需要导入模块: from EDConfiguration import EDConfiguration [as 别名]
# 或者: from EDConfiguration.EDConfiguration import load [as 别名]
 def testGenerateMOSFLMIntegrationCommands(self):
     strPathToTestConfigFile = os.path.join(self.strUnitTestDataHome, "XSConfiguration_unitTest.xml")
     edConfiguration = EDConfiguration(strPathToTestConfigFile)
     edConfiguration.load()
     xsPluginItem = edConfiguration.getPluginItem("EDPluginMOSFLMIntegrationv10")
     pluginIntegration = self.createPlugin()
     pluginIntegration.setScriptExecutable("cat")
     pluginIntegration.setConfiguration(xsPluginItem)
     pluginIntegration.configure()
     strXMLInputData = self.readAndParseFile (self.strReferenceDataInputFile)
     pluginIntegration.setDataInput(strXMLInputData)
     pluginIntegration.generateMOSFLMCommands()
     listCommandExecution = pluginIntegration.getListCommandExecution()
     listCommandReference = ['WAVELENGTH 0.934', 'DISTANCE 198.440994', 'BEAM 102.478996 104.8862', 'DETECTOR ADSC', 'DIRECTORY ' + self.strDataImagePath, 'TEMPLATE ref-testscale_1_###.img', 'SYMMETRY P222', 'MATRIX ' + pluginIntegration.getScriptBaseName() + '_matrix.mat', 'MOSAIC 0.75', 'HKLOUT process_1_1.mtz', 'PROCESS 1 TO 1 START 0.000000 ANGLE 1.000000', 'BEST ON', 'GO', 'BEST OFF']
     EDAssert.equal(listCommandReference, listCommandExecution)
开发者ID:olofsvensson,项目名称:edna-plugins-mx,代码行数:17,代码来源:EDTestCasePluginUnitMOSFLMIntegrationv10.py

示例5: testExecute

# 需要导入模块: from EDConfiguration import EDConfiguration [as 别名]
# 或者: from EDConfiguration.EDConfiguration import load [as 别名]
 def testExecute(self):
     """
     Runs the plugin and then compares expected output with obtained output to verify that it executed correctly. 
     """
     for i in range(100):
         # We set up the plugin manually as it has to be executed many times
         edPlugin = self.createPlugin()
         edConfiguration = EDConfiguration(self.getConfigurationFile())
         edConfiguration.load()
         edPlugin.setConfiguration(edConfiguration.getPluginItem("EDPluginISPyBStoreAutoProcv1_4"))
         edPlugin.setDataInput(EDUtilsFile.readFileAndParseVariables(self.getDataInputFile()))
         edPlugin.executeSynchronous()
         # Check that the id extists in the results
         xsDataResult = edPlugin.getDataOutput()
         bAttributeExists = True
         if xsDataResult.getAutoProcId() is None:
             bAttributeExists = False
         EDAssert.equal(True, bAttributeExists, "Attribute AutoProcId %d in the result" % xsDataResult.autoProcId.value)
开发者ID:antolinos,项目名称:edna,代码行数:20,代码来源:EDTestCasePluginExecuteISPyBStoreAutoProcv1_4_loadTest.py

示例6: getProjectPluginConfiguration

# 需要导入模块: from EDConfiguration import EDConfiguration [as 别名]
# 或者: from EDConfiguration.EDConfiguration import load [as 别名]
 def getProjectPluginConfiguration(_pluginName):
     """
     """
     EDVerbose.DEBUG("EDApplication.getProjectPluginConfiguration")
     pluginConfiguration = None
     strPathToProjectConfigurationFile = EDFactoryPluginStatic.getPathToProjectConfigurationFile(_pluginName)
     EDApplication.synchronizeOn()
     if (strPathToProjectConfigurationFile is not None):
         edConfigurationProject = EDConfiguration(strPathToProjectConfigurationFile)
         edConfigurationProject.load()
         if (edConfigurationProject is not None):
             pluginConfiguration = edConfigurationProject.getPluginItem(_pluginName)
     if (pluginConfiguration is None):
         EDVerbose.DEBUG("EDApplication.getProjectPluginConfiguration: No project configuration found for %s " % _pluginName)
     else:
         EDVerbose.DEBUG("EDApplication.getProjectPluginConfiguration: Reading %s configuration from %s" % (\
                          _pluginName, \
                          strPathToProjectConfigurationFile))
     EDApplication.synchronizeOff()
     return pluginConfiguration
开发者ID:olofsvensson,项目名称:edna-kernel,代码行数:22,代码来源:EDApplication.py

示例7: getPluginConfiguration

# 需要导入模块: from EDConfiguration import EDConfiguration [as 别名]
# 或者: from EDConfiguration.EDConfiguration import load [as 别名]
 def getPluginConfiguration(self, _strPluginName=None):
     # Load the configuration file if provided
     if _strPluginName == None:
         _strPluginName = self.getPluginName()
     if _strPluginName in self.__dictConfigurations :
         xsConfiguration = self.__dictConfigurations[_strPluginName]
     else:
         xsConfiguration = None
         if (self.__strConfigurationFile is not None):
             edConfigurationTest = EDConfiguration(self.__strConfigurationFile)
             edConfigurationTest.load()
             if (edConfigurationTest is not None):
                 xsConfiguration = edConfigurationTest.getPluginItem(_strPluginName)
         if xsConfiguration is None:
             xsConfiguration = EDApplication.getApplicationPluginConfiguration(_strPluginName)
         if xsConfiguration is None:
             # No application wide configuration file found! Try to find a project specific config file:
             xsConfiguration = EDApplication.getProjectPluginConfiguration(_strPluginName)
         if xsConfiguration is None:
             EDVerbose.WARNING("EDTestCasePlugin.getPluginConfiguration: xsConfiguration is still None after all guesses: Expect to fail soon")
         self.__dictConfigurations[_strPluginName] = xsConfiguration
     return xsConfiguration
开发者ID:olofsvensson,项目名称:edna-kernel,代码行数:24,代码来源:EDTestCasePlugin.py

示例8: EDTestCaseEDConfiguration

# 需要导入模块: from EDConfiguration import EDConfiguration [as 别名]
# 或者: from EDConfiguration.EDConfiguration import load [as 别名]
class EDTestCaseEDConfiguration(EDTestCase):


    def __init__(self, _strTestName=None):
        EDTestCase.__init__(self, "EDTestCaseEDConfiguration")
        self.__edConfiguration = None
        strKernelDataHome = EDUtilsTest.getPluginTestDataDirectory(self.getClassName())
        strDataDir = "EDConfiguration"
        self.___strDataPath = EDUtilsPath.mergePath(strKernelDataHome, strDataDir)


    def preProcess(self):
        """
        Constructs the utilitary EDConfiguration class
        """
        #Loads py module directly using xml configuration file
        self.___edConfiguration = EDConfiguration(os.path.join(self.___strDataPath, "XSConfiguration.xml"))
        self.___edConfiguration.load()


    def testGetPluginList(self):
        """
        Testing the retrieved XSPluginList from configuration
        """
        edPluginList = self.___edConfiguration.getPluginList()
        EDAssert.equal(2, self.___edConfiguration.getPluginListSize())


    def testGetPluginItem(self):
        """
        Testing Plugin indexingMosflm Configuration
        """
        xsPluginItem = self.___edConfiguration.getPluginItem("indexingMosflm")
        EDAssert.equal("indexingMosflm", xsPluginItem.getName())

        paramList = xsPluginItem.getXSParamList()
        paramItems = paramList.getXSParamItem()

        EDAssert.equal("workingDir", paramItems[0].getName())
        EDAssert.equal("/path/to/working/dir", paramItems[0].getValue())
        EDAssert.equal("number", paramItems[1].getName())
        EDAssert.equal("3", paramItems[1].getValue())


    def testGetPluginItemError(self):
        """
        Testing the retrieval of an absent plugin
        """
        EDAssert.equal(None, self.___edConfiguration.getPluginItem("toto"))


    def testGetParamItem(self):
        """
        Testing the XSParamItem inside an XSPluginItem
        """
        xsPluginItem = self.___edConfiguration.getPluginItem("indexingMosflm")
        xsParamItem = self.___edConfiguration.getParamItem(xsPluginItem, "workingDir")
        EDAssert.equal("workingDir", xsParamItem.getName())


    def testGetParamValue(self):
        """
        Testing the XSParamItem Value convertion from string to different formats
        """
        xsPluginItem = self.___edConfiguration.getPluginItem("indexingMosflm")
        EDAssert.equal("/path/to/working/dir", self.___edConfiguration.getStringParamValue(xsPluginItem, "workingDir"))
        EDAssert.equal("/path/to/working/dir", EDConfiguration.getStringParamValue(xsPluginItem, "workingDir"))
        EDAssert.equal(3, self.___edConfiguration.getIntegerParamValue(xsPluginItem, "number"))
        EDAssert.equal(3, EDConfiguration.getIntegerParamValue(xsPluginItem, "number"))


    def testGetOptionItem(self):
        """
        Testing the XSOptionItem inside an XSPluginItem
        """
        xsPluginItem = self.___edConfiguration.getPluginItem("indexing")
        xsOptionItemMosflm = self.___edConfiguration.getOptionItem(xsPluginItem, "indexingMosflm")
        EDAssert.equal(True, xsOptionItemMosflm.getEnabled())

        xsOptionItemXds = self.___edConfiguration.getOptionItem(xsPluginItem, "indexingXds")
        EDAssert.equal(False, xsOptionItemXds.getEnabled())

        xsOptionItemLabelit = self.___edConfiguration.getOptionItem(xsPluginItem, "indexingLabelit")
        EDAssert.equal(False, xsOptionItemLabelit.getEnabled())


    def process(self):
        self.addTestMethod(self.testGetPluginList)
        self.addTestMethod(self.testGetPluginItem)
        self.addTestMethod(self.testGetPluginItemError)
        self.addTestMethod(self.testGetParamItem)
        self.addTestMethod(self.testGetParamValue)
        self.addTestMethod(self.testGetOptionItem)
开发者ID:olofsvensson,项目名称:edna-kernel,代码行数:95,代码来源:EDTestCaseEDConfiguration.py


注:本文中的EDConfiguration.EDConfiguration.load方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。