本文整理汇总了Python中pyral.Rally.typedef方法的典型用法代码示例。如果您正苦于以下问题:Python Rally.typedef方法的具体用法?Python Rally.typedef怎么用?Python Rally.typedef使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyral.Rally
的用法示例。
在下文中一共展示了Rally.typedef方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from pyral import Rally [as 别名]
# 或者: from pyral.Rally import typedef [as 别名]
def main(args):
options = [opt for opt in args if opt.startswith('--')]
args = [arg for arg in args if arg not in options]
server, user, password, workspace, project = rallySettings(options)
#print " ".join(["|%s|" % item for item in [server, user, password, workspace, project]])
if not args:
print "You must supply an entity name!"
sys.exit(1)
query = ""
target = args[0]
if target in ['UserStory', 'User Story', 'Story']:
target = "HierarchicalRequirement"
if '/' in target:
parent, entity = target.split('/', 1)
target = entity
query = 'ElementName = "%s"' % target
try:
rally = Rally(server, user=user, password=password)
except Exception as ex:
errout(str(ex.args[0]))
sys.exit(1)
typedef = rally.typedef(target)
showAttributes(typedef.Attributes)
print ""
print "-" * 64
print ""
for ix, ancestor in enumerate(typedef.inheritanceChain()):
print "%s %s" % (" " * (ix*4), ancestor)
示例2: main
# 需要导入模块: from pyral import Rally [as 别名]
# 或者: from pyral.Rally import typedef [as 别名]
def main(args):
options = [opt for opt in args if opt.startswith('--')]
args = [arg for arg in args if arg not in options]
if not args:
errout("ERROR: You must supply an entity name!\n")
sys.exit(1)
server, username, password, apikey, workspace, project = rallyWorkset(options)
try:
if apikey:
rally = Rally(server, apikey=apikey, workspace=workspace, project=project)
else:
rally = Rally(server, user=username, password=password, workspace=workspace, project=project)
except Exception as ex:
errout(str(ex.args[0]))
sys.exit(1)
entity = args[0]
if entity in ['UserStory', 'User Story', 'Story']:
entity = "HierarchicalRequirement"
#if '/' in entity:
# parent, entity = entity.split('/', 1)
schema_item = rally.typedef(entity)
print(schema_item)
示例3: main
# 需要导入模块: from pyral import Rally [as 别名]
# 或者: from pyral.Rally import typedef [as 别名]
def main(args):
options = [opt for opt in args if opt.startswith('--')]
args = [arg for arg in args if arg not in options]
server, user, password, workspace, project = rallySettings(options)
#print " ".join(["|%s|" % item for item in [server, user, '********', workspace, project]])
if not args:
errout("ERROR: You must supply an entity name!\n")
sys.exit(1)
entity = args[0]
if entity in ['UserStory', 'User Story', 'Story']:
entity = "HierarchicalRequirement"
#if '/' in entity:
# parent, entity = entity.split('/', 1)
try:
rally = Rally(server, user=user, password=password)
except Exception as ex:
errout(str(ex.args[0]))
sys.exit(1)
schema_item = rally.typedef(entity)
print schema_item
示例4: test_typedef
# 需要导入模块: from pyral import Rally [as 别名]
# 或者: from pyral.Rally import typedef [as 别名]
def test_typedef():
"""
Using a known valid Rally server and known valid access credentials,
exercise the Rally.typedef convenience method using 'Portfolio/Feature'
as a target.
"""
rally = Rally(server=TRIAL, user=TRIAL_USER, password=TRIAL_PSWD)
target_type = 'PortfolioItem/Feature'
td = rally.typedef(target_type)
assert td != None
assert td._type == 'TypeDefinition'
assert td.TypePath == 'PortfolioItem/Feature'
assert td.ref.startswith('typedefinition/')
示例5: main
# 需要导入模块: from pyral import Rally [as 别名]
# 或者: from pyral.Rally import typedef [as 别名]
def main(args):
options = [opt for opt in args if opt.startswith('--')]
args = [arg for arg in args if arg not in options]
if not args:
print("You must supply an entity name!")
sys.exit(1)
query = ""
target = args[0]
if target in ['UserStory', 'User Story', 'Story']:
target = "HierarchicalRequirement"
if '/' in target:
parent, entity = target.split('/', 1)
target = entity
query = 'ElementName = "%s"' % target
server, username, password, apikey, workspace, project = rallyWorkset(options)
print(" ".join(["|%s|" % item for item in [server, username, password, apikey, workspace, project]]))
try:
rally = Rally(server, username, password, apikey=apikey, workspace=workspace, server_ping=False)
except Exception as ex:
errout(str(ex.args[0]))
sys.exit(1)
sub_name = rally.subscriptionName()
print("Subscription Name: %s" % sub_name)
wksp = rally.getWorkspace()
print("Workspace Name: %s" % wksp.Name)
print("Entity: %s" % target)
print("-----------")
print("Attributes:")
print("-----------")
typedef = rally.typedef(target)
showAttributes(rally, target, typedef.Attributes)
print("")
print("-" * 64)
print("")
for ix, ancestor in enumerate(typedef.inheritanceChain()):
print("%s %s" % (" " * (ix*4), ancestor))