本文整理汇总了Python中DIRAC.ConfigurationSystem.Client.Helpers.Resources.getDIRACPlatforms方法的典型用法代码示例。如果您正苦于以下问题:Python Resources.getDIRACPlatforms方法的具体用法?Python Resources.getDIRACPlatforms怎么用?Python Resources.getDIRACPlatforms使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DIRAC.ConfigurationSystem.Client.Helpers.Resources
的用法示例。
在下文中一共展示了Resources.getDIRACPlatforms方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setPlatform
# 需要导入模块: from DIRAC.ConfigurationSystem.Client.Helpers import Resources [as 别名]
# 或者: from DIRAC.ConfigurationSystem.Client.Helpers.Resources import getDIRACPlatforms [as 别名]
def setPlatform( self, platform ):
"""Developer function: sets the target platform, e.g. Linux_x86_64_glibc-2.5.
This platform is in the form of what it is returned by the dirac-platform script
(or dirac-architecture if your extension provides it)
"""
kwargs = {'platform':platform}
if not isinstance( platform, basestring ):
return self._reportError( "Expected string for platform", **kwargs )
if not platform.lower() == 'any':
availablePlatforms = Resources.getDIRACPlatforms()
if not availablePlatforms['OK']:
return self._reportError( "Can't check for platform", **kwargs )
if platform in availablePlatforms['Value']:
self._addParameter( self.workflow, 'Platform', 'JDL', platform, 'Platform ( Operating System )' )
else:
return self._reportError( "Invalid platform", **kwargs )
return S_OK()
示例2: setPlatform
# 需要导入模块: from DIRAC.ConfigurationSystem.Client.Helpers import Resources [as 别名]
# 或者: from DIRAC.ConfigurationSystem.Client.Helpers.Resources import getDIRACPlatforms [as 别名]
def setPlatform(self, platform):
"""Developer function: sets the target platform, e.g. Linux_x86_64_glibc-2.5.
This platform is in the form of what it is returned by the dirac-platform script
(or dirac-architecture if your extension provides it)
"""
kwargs = {"platform": platform}
if not type(platform) == type(" "):
return self._reportError("Expected string for platform", **kwargs)
if not platform.lower() == "any":
availablePlatforms = Resources.getDIRACPlatforms()
if not availablePlatforms["OK"]:
return self._reportError("Can't check for platform", **kwargs)
if platform in availablePlatforms["Value"]:
self._addParameter(self.workflow, "Platform", "JDL", platform, "Platform ( Operating System )")
else:
return self._reportError("Invalid platform", **kwargs)
return S_OK()