本文整理汇总了Python中EDConfiguration.EDConfiguration.getPluginItem方法的典型用法代码示例。如果您正苦于以下问题:Python EDConfiguration.getPluginItem方法的具体用法?Python EDConfiguration.getPluginItem怎么用?Python EDConfiguration.getPluginItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EDConfiguration.EDConfiguration
的用法示例。
在下文中一共展示了EDConfiguration.getPluginItem方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testRasterConfiguration
# 需要导入模块: from EDConfiguration import EDConfiguration [as 别名]
# 或者: from EDConfiguration.EDConfiguration import getPluginItem [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")
示例2: getPluginConfiguration
# 需要导入模块: from EDConfiguration import EDConfiguration [as 别名]
# 或者: from EDConfiguration.EDConfiguration import getPluginItem [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
示例3: testGenerateMOSFLMIntegrationCommands
# 需要导入模块: from EDConfiguration import EDConfiguration [as 别名]
# 或者: from EDConfiguration.EDConfiguration import getPluginItem [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)
示例4: testExecute
# 需要导入模块: from EDConfiguration import EDConfiguration [as 别名]
# 或者: from EDConfiguration.EDConfiguration import getPluginItem [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)
示例5: getProjectPluginConfiguration
# 需要导入模块: from EDConfiguration import EDConfiguration [as 别名]
# 或者: from EDConfiguration.EDConfiguration import getPluginItem [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
示例6: getPluginConfiguration
# 需要导入模块: from EDConfiguration import EDConfiguration [as 别名]
# 或者: from EDConfiguration.EDConfiguration import getPluginItem [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
示例7: EDTestCaseEDConfiguration
# 需要导入模块: from EDConfiguration import EDConfiguration [as 别名]
# 或者: from EDConfiguration.EDConfiguration import getPluginItem [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)