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


Python TEST_MAP.values方法代码示例

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


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

示例1: or

# 需要导入模块: from workspace_tools.tests import TEST_MAP [as 别名]
# 或者: from workspace_tools.tests.TEST_MAP import values [as 别名]
                   default=None, help="The mbed serial port")
 parser.add_option("-b", "--baud", type="int", dest="baud",
                   default=None, help="The mbed serial baud rate")
 
 # Ideally, all the tests with a single "main" thread can be run with, or
 # without the rtos
 parser.add_option("--rtos", action="store_true", dest="rtos",
                   default=False, help="Link to the rtos")
 
 (options, args) = parser.parse_args()
 
 # Program Number
 p = options.program
 if p is None or (p < 0) or (p > (len(TESTS)-1)):
     message = "[ERROR] You have to specify one of the following tests:\n"
     descriptions = [(test.n, test.description) for test in TEST_MAP.values()]
     descriptions.sort()
     message += '\n'.join(["  [%2d] %s " % d for d in descriptions])
     args_error(parser, message)
 
 # Target
 if options.mcu is None :
     args_error(parser, "[ERROR] You should specify an MCU")
 mcu = options.mcu
 
 # Toolchain
 if options.tool is None:
     args_error(parser, "[ERROR] You should specify a TOOLCHAIN")
 toolchain = options.tool
 
 # Test
开发者ID:3eggert,项目名称:mbed,代码行数:33,代码来源:make.py

示例2: sorted

# 需要导入模块: from workspace_tools.tests import TEST_MAP [as 别名]
# 或者: from workspace_tools.tests.TEST_MAP import values [as 别名]
                      default=False, help="List available tests in order and exit")

    # Ideally, all the tests with a single "main" thread can be run with, or
    # without the rtos
    parser.add_option("--rtos", action="store_true", dest="rtos",
                      default=False, help="Link to the rtos")

    # Specify a different linker script
    parser.add_option("-l", "--linker", dest="linker_script",
                      default=None, help="use the specified linker script")

    (options, args) = parser.parse_args()

    # Print available tests in order and exit
    if options.list_tests is True:
        print '\n'.join(map(str, sorted(TEST_MAP.values())))
        sys.exit()

    # force program to "0" if a source dir is specified
    if options.source_dir is not None:
        p = 0
        n = None
    else:
    # Program Number or name
        p, n = options.program, options.program_name

    if n is not None and p is not None:
        args_error(parser, "[ERROR] specify either '-n' or '-p', not both")
    if n:
        if not n in TEST_MAP.keys():
            # Check if there is an alias for this in private_settings.py
开发者ID:AsamQi,项目名称:mbed,代码行数:33,代码来源:make.py

示例3: args_error

# 需要导入模块: from workspace_tools.tests import TEST_MAP [as 别名]
# 或者: from workspace_tools.tests.TEST_MAP import values [as 别名]
    (options, args) = parser.parse_args()

    # Target
    if options.mcu is None:
        args_error(parser, "[ERROR] You should specify an MCU")
    mcu = options.mcu

    # IDE
    if options.ide is None:
        args_error(parser, "[ERROR] You should specify an IDE")
    ide = options.ide

    # Project
    if options.program is None or (options.program < 0) or (options.program > (len(TESTS) - 1)):
        message = "[ERROR] You have to specify one of the following tests:\n"
        message += "\n".join(map(str, sorted(TEST_MAP.values())))
        args_error(parser, message)
    test = Test(options.program)

    if not options.build:
        # Substitute the library builds with the sources
        # TODO: Substitute also the other library build paths
        if MBED_LIBRARIES in test.dependencies:
            test.dependencies.remove(MBED_LIBRARIES)
            test.dependencies.append(MBED_BASE)

    # Build the projectwith the same directory structure of the mbed online IDE
    project_dir = join(EXPORT_WORKSPACE, test.id)
    setup_user_prj(project_dir, test.source_dir, test.dependencies)

    # Export to selected toolchain
开发者ID:Joey-Ye,项目名称:mbed,代码行数:33,代码来源:project.py


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