本文整理汇总了Python中henmanager.HenManager.getExperiments方法的典型用法代码示例。如果您正苦于以下问题:Python HenManager.getExperiments方法的具体用法?Python HenManager.getExperiments怎么用?Python HenManager.getExperiments使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类henmanager.HenManager
的用法示例。
在下文中一共展示了HenManager.getExperiments方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: HenManager
# 需要导入模块: from henmanager import HenManager [as 别名]
# 或者: from henmanager.HenManager import getExperiments [as 别名]
###########################################################################################
# Make sure that the necessary cgi parameters are given and retrieve them
form = cgi.FieldStorage()
if ((not form) or (not form.has_key("action"))):
sys.exit()
print "Content-Type: text/xml"
print ""
print ""
print '<experiments>'
manager = HenManager()
action = form["action"].value
experiments = manager.getExperiments()
if (action == "getexperiments"):
if (not form.has_key("username")):
print '</experiments>'
sys.exit()
username = form["username"].value
# Retrieve the user's experiment groups from the LDAP server (hard-coded for now)
userExperimentGroups = ["dostunneling"]
for experiment in experiments.values():
experimentID = experiment.getExperimentID()
experimentGroups = experiment.getExperimentGroups()
user = experiment.getUser().getUsername()