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


Python EDConfiguration.getParamItem方法代码示例

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


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

示例1: configure

# 需要导入模块: from EDConfiguration import EDConfiguration [as 别名]
# 或者: from EDConfiguration.EDConfiguration import getParamItem [as 别名]
 def configure(self, _edPlugin = None):
     EDPluginControl.configure(self)
     self.DEBUG("EDPluginControlReadImageHeaderv10.configure")
     if self.getConfiguration():
         xsDataStringParameter = EDConfiguration.getParamItem(self.getConfiguration(), "waitFileTimeOut")
         if xsDataStringParameter:
             self.fWaitFileTimeOut = float(xsDataStringParameter.getValue())
开发者ID:antolinos,项目名称:edna,代码行数:9,代码来源:EDPluginControlImageQualityIndicatorsv1_1.py

示例2: configure

# 需要导入模块: from EDConfiguration import EDConfiguration [as 别名]
# 或者: from EDConfiguration.EDConfiguration import getParamItem [as 别名]
 def configure(self):
     EDPluginExecProcessScript.configure(self)
     EDVerbose.DEBUG("EDPluginMOSFLMv10.configure")
     self.setRequireCCP4(True)
     self.setScriptCommandline(" DNA " + self.getScriptBaseName() + "_dnaTables.xml")
     # Check for reversephi configuration option
     if self.getConfiguration():
         xsDataStringParameter = EDConfiguration.getParamItem(self.getConfiguration(), "reversephi")
         if xsDataStringParameter:
             strReversephi = xsDataStringParameter.getValue()
             if  strReversephi is not None:
                 if strReversephi.lower() == "true":
                     self.bReversephi = True
         xsDataStringParameterRaster = EDConfiguration.getParamItem(self.getConfiguration(), "raster")
         if xsDataStringParameterRaster:
             self.strRaster = xsDataStringParameterRaster.getValue()
开发者ID:olofsvensson,项目名称:edna-plugins-mx,代码行数:18,代码来源:EDPluginMOSFLMv10.py

示例3: getStringConfigurationParameterValue

# 需要导入模块: from EDConfiguration import EDConfiguration [as 别名]
# 或者: from EDConfiguration.EDConfiguration import getParamItem [as 别名]
    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.
        
        The configuration parameter is then searched in the configration file in following order:
          - If a plugin configuration item exists and the configration parameter name is present it will be used.
          - Otherwise if a product-wide (e.g. "mxPluginExec") configuration value exists it will be used.         
        """
        self.DEBUG("EDPlugin.getConfigurationParameterValue")
        strParameteValue = None
        xsPluginItem = self.getConfiguration()
        bFoundConfigurationParameter = False
        if xsPluginItem:
            strParameteValue = EDConfiguration.getParamItem(xsPluginItem, _strConfigurationParameterName).getValue()
            if strParameteValue:
                bFoundConfigurationParameter = True

        if not bFoundConfigurationParameter:
            xsPluginItem = EDApplication.getApplicationPluginConfiguration(self.getPluginName())
            if xsPluginItem:
                strParameteValue = EDConfiguration.getParamItem(xsPluginItem, _strConfigurationParameterName).getValue()
                if strParameteValue:
                    bFoundConfigurationParameter = True

        if not bFoundConfigurationParameter:
            xsPluginItem = EDApplication.getProjectPluginConfiguration(self.getPluginName())
            if xsPluginItem:
                strParameteValue = EDConfiguration.getParamItem(xsPluginItem, _strConfigurationParameterName).getValue()
                if strParameteValue:
                    bFoundConfigurationParameter = True

        return strParameteValue
开发者ID:olofsvensson,项目名称:edna-kernel,代码行数:38,代码来源:EDPlugin.py

示例4: EDTestCaseEDConfiguration

# 需要导入模块: from EDConfiguration import EDConfiguration [as 别名]
# 或者: from EDConfiguration.EDConfiguration import getParamItem [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.getParamItem方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。