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


Python Rally.typedef方法代码示例

本文整理汇总了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)
开发者ID:bimsapi,项目名称:RallyRestToolkitForPython,代码行数:36,代码来源:typedef.py

示例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)
开发者ID:RallyTools,项目名称:RallyRestToolkitForPython,代码行数:28,代码来源:get_schema.py

示例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
开发者ID:bimsapi,项目名称:RallyRestToolkitForPython,代码行数:27,代码来源:get_schema.py

示例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/')
开发者ID:RallyTools,项目名称:RallyRestToolkitForPython,代码行数:15,代码来源:test_convenience.py

示例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))
开发者ID:amcolosk,项目名称:RallyRestToolkitForPython,代码行数:44,代码来源:typedef.py


注:本文中的pyral.Rally.typedef方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。