本文整理汇总了Python中EDConfiguration.EDConfiguration.getXSConfigurationItem方法的典型用法代码示例。如果您正苦于以下问题:Python EDConfiguration.getXSConfigurationItem方法的具体用法?Python EDConfiguration.getXSConfigurationItem怎么用?Python EDConfiguration.getXSConfigurationItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EDConfiguration.EDConfiguration
的用法示例。
在下文中一共展示了EDConfiguration.getXSConfigurationItem方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testGetXSConfigurationItem2
# 需要导入模块: from EDConfiguration import EDConfiguration [as 别名]
# 或者: from EDConfiguration.EDConfiguration import getXSConfigurationItem [as 别名]
def testGetXSConfigurationItem2(self):
edConfiguration = EDConfiguration()
xsDataPluginItem1 = edConfiguration.getXSConfigurationItem("EDPluginTestPluginFactory")
EDAssert.equal(True, xsDataPluginItem1 is not None, "Obtanied configuration for EDPluginTestPluginFactory")
xsDataPluginItem2 = edConfiguration.getXSConfigurationItem("EDPluginTestPluginFactoryImport1")
EDAssert.equal(True, xsDataPluginItem2 is not None, "Obtanied imported configuration for EDPluginTestPluginFactoryImport1")
xsDataPluginItem3 = edConfiguration.getXSConfigurationItem("EDPluginTestPluginFactoryImport2")
EDAssert.equal(True, xsDataPluginItem3 is not None, "Obtanied imported configuration for EDPluginTestPluginFactoryImport2")
示例2: testSetXSConfigurationItem
# 需要导入模块: from EDConfiguration import EDConfiguration [as 别名]
# 或者: from EDConfiguration.EDConfiguration import getXSConfigurationItem [as 别名]
def testSetXSConfigurationItem(self):
xsPluginItem = XSPluginItem()
xsPluginItem.name = "EDPluginTestSetConfig"
edConfiguration = EDConfiguration()
edConfiguration.setXSConfigurationItem(xsPluginItem)
xsDataPluginItem = edConfiguration.getXSConfigurationItem("EDPluginTestSetConfig")
EDAssert.equal(True, xsDataPluginItem is not None, "Obtanied set configuration")
示例3: testRasterConfiguration
# 需要导入模块: from EDConfiguration import EDConfiguration [as 别名]
# 或者: from EDConfiguration.EDConfiguration import getXSConfigurationItem [as 别名]
def testRasterConfiguration(self):
strPathToTestConfigFile = os.path.join(self.strUnitTestDataHome, "XSConfiguration_raster.xml")
edConfiguration = EDConfiguration(strPathToTestConfigFile)
xsPluginItem = edConfiguration.getXSConfigurationItem("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")
示例4: testGetPluginItemError
# 需要导入模块: from EDConfiguration import EDConfiguration [as 别名]
# 或者: from EDConfiguration.EDConfiguration import getXSConfigurationItem [as 别名]
def testGetPluginItemError(self):
"""
Testing the retrieval of an absent plugin
"""
strPath = os.path.join(self.strDataPath, "XSConfiguration.xml")
edConfiguration = EDConfiguration()
edConfiguration.addConfigurationFile(strPath)
xsPluginItem = edConfiguration.getXSConfigurationItem("toto")
EDAssert.equal(None, xsPluginItem, "Non-existing configuration item should be None")
示例5: testGetParamValue
# 需要导入模块: from EDConfiguration import EDConfiguration [as 别名]
# 或者: from EDConfiguration.EDConfiguration import getXSConfigurationItem [as 别名]
def testGetParamValue(self):
"""
Testing the XSParamItem Value convertion from string to different formats
"""
strPath = os.path.join(self.strDataPath, "XSConfiguration.xml")
edConfiguration = EDConfiguration()
edConfiguration.addConfigurationFile(strPath)
xsPluginItem = edConfiguration.getXSConfigurationItem("indexingMosflm")
EDAssert.equal("/path/to/working/dir", edConfiguration.getStringParamValue(xsPluginItem, "workingDir"))
EDAssert.equal("/path/to/working/dir", EDConfiguration.getStringParamValue(xsPluginItem, "workingDir"))
EDAssert.equal(3, edConfiguration.getIntegerParamValue(xsPluginItem, "number"))
EDAssert.equal(3, EDConfiguration.getIntegerParamValue(xsPluginItem, "number"))
示例6: getPluginConfiguration
# 需要导入模块: from EDConfiguration import EDConfiguration [as 别名]
# 或者: from EDConfiguration.EDConfiguration import getXSConfigurationItem [as 别名]
def getPluginConfiguration(self, _strConfigurationFileName):
"""
Returns the plugin configuration from a configuration file
"""
xsPluginItem = None
edConfiguration = EDConfiguration(_strConfigurationFileName)
if(edConfiguration != None):
xsPluginItem = edConfiguration.getXSConfigurationItem(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
示例7: testGenerateMOSFLMIntegrationCommands
# 需要导入模块: from EDConfiguration import EDConfiguration [as 别名]
# 或者: from EDConfiguration.EDConfiguration import getXSConfigurationItem [as 别名]
def testGenerateMOSFLMIntegrationCommands(self):
strPathToTestConfigFile = os.path.join(self.strUnitTestDataHome, "XSConfiguration_unitTest.xml")
edConfiguration = EDConfiguration(strPathToTestConfigFile)
xsPluginItem = edConfiguration.getXSConfigurationItem("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)
示例8: testGetPluginItem
# 需要导入模块: from EDConfiguration import EDConfiguration [as 别名]
# 或者: from EDConfiguration.EDConfiguration import getXSConfigurationItem [as 别名]
def testGetPluginItem(self):
"""
Testing Plugin indexingMosflm Configuration
"""
strPath = os.path.join(self.strDataPath, "XSConfiguration.xml")
edConfiguration = EDConfiguration()
edConfiguration.addConfigurationFile(strPath)
xsPluginItem = edConfiguration.getXSConfigurationItem("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())
示例9: EDPlugin
# 需要导入模块: from EDConfiguration import EDConfiguration [as 别名]
# 或者: from EDConfiguration.EDConfiguration import getXSConfigurationItem [as 别名]
#.........这里部分代码省略.........
if self.__bWriteDataXMLOutput:
self.writeDataOutput()
def synchronize(self):
"""
This method calls EDAction.synchronize and if a time-out occurs an error message
is added to the list of error messages.
"""
EDAction.synchronize(self)
if self.isTimeOut():
strErrorMessage = "Timeout when waiting for %s to terminate." % self.getClassName()
self.addErrorMessage(strErrorMessage)
@deprecated
def setConfiguration(self, _xsPluginItem):
"""
Receives a Plugin Configuration as XSPluginItem or python dict from the application.
"""
self.DEBUG("EDPlugin.setConfiguration")
self.__edConfiguration = EDConfiguration()
if isinstance(_xsPluginItem, dict):
self.__edConfiguration[self.getPluginName()] = _xsPluginItem
else:
self.__edConfiguration.setXSConfigurationItem(_xsPluginItem)
@deprecated
def getConfiguration(self):
"""
Gets the Plugin Configuration as an XSPluginItem
"""
self.DEBUG("EDPlugin.getConfiguration")
return self.__edConfiguration.getXSConfigurationItem(self.getPluginName())
configuration = property(getConfiguration, setConfiguration)
def getConfig(self):
"""
Gets the Plugin Configuration as a dictionary
"""
self.DEBUG("EDPlugin.getConfig")
return self.__edConfiguration.get(self.getPluginName(), {})
def setConfig(self, _dict, _bLocal = False):
"""
Receives a dictionary (Plugin Configuration) from the application.
"""
self.DEBUG("EDPlugin.setConfiguration")
if _bLocal:
self.__edConfiguration = EDConfiguration()
if _dict is not None:
self.__edConfiguration[self.getPluginName()] = _dict
else:
self.__edConfiguration[self.getPluginName()] = {}
config = property(getConfig, setConfig)
@deprecated
def getStringConfigurationParameterValue(self, _strConfigurationParameterName):
"""
This method returns a configuration parameter value if a corresponding configuration
parameter name can be found in the configuration file.
If an application wide configuration file is provided via EDApplication it will
override the product configuration file.
示例10: testGetXSConfigurationItem1
# 需要导入模块: from EDConfiguration import EDConfiguration [as 别名]
# 或者: from EDConfiguration.EDConfiguration import getXSConfigurationItem [as 别名]
def testGetXSConfigurationItem1(self):
strPath = os.path.join(self.strDataPath, "XSConfiguration.xml")
edConfiguration = EDConfiguration()
edConfiguration.addConfigurationFile(strPath)
xsDataPluginItem = edConfiguration.getXSConfigurationItem("indexingMosflm")
EDAssert.equal(True, xsDataPluginItem is not None, "Obtanied configuration for indexingMosflm")