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


Python FileSystem.normpath方法代码示例

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


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

示例1: adjust_options

# 需要导入模块: from common_py.system.filesystem import FileSystem [as 别名]
# 或者: from common_py.system.filesystem.FileSystem import normpath [as 别名]
def adjust_options(options):
    # First fix some option inconsistencies.
    if options.target_os in ['nuttx', 'tizenrt']:
        options.buildlib = True
        if not options.sysroot:
            ex.fail('--sysroot needed for %s target' % options.target_os)

        options.sysroot = fs.abspath(options.sysroot)
        if not fs.exists(options.sysroot):
            ex.fail('NuttX sysroot %s does not exist' % options.sysroot)

    if options.target_arch == 'x86':
        options.target_arch = 'i686'
    if options.target_arch == 'x64':
        options.target_arch = 'x86_64'

    if options.target_os == 'darwin':
        options.no_check_valgrind = True

    if options.target_board in ['rpi2', 'rpi3', 'artik10', 'artik05x']:
        options.no_check_valgrind = True

    # Then add calculated options.
    options.host_tuple = '%s-%s' % (platform.arch(), platform.os())
    options.target_tuple = '%s-%s' % (options.target_arch, options.target_os)

    # Normalize the path of build directory.
    options.builddir = fs.normpath(options.builddir)

    options.build_root = fs.join(path.PROJECT_ROOT,
                                 options.builddir,
                                 options.target_tuple,
                                 options.buildtype)

    cmake_path = fs.join(path.PROJECT_ROOT, 'cmake', 'config', '%s.cmake')
    options.cmake_toolchain_file = cmake_path % options.target_tuple

    # Set the default value of '--js-backtrace' if it is not defined.
    if not options.js_backtrace:
        if options.buildtype == 'debug':
            options.js_backtrace = "ON"
        else:
            options.js_backtrace = "OFF"
开发者ID:Samsung,项目名称:iotjs,代码行数:45,代码来源:build.py

示例2: adjust_options

# 需要导入模块: from common_py.system.filesystem import FileSystem [as 别名]
# 或者: from common_py.system.filesystem.FileSystem import normpath [as 别名]
def adjust_options(options):
    # First fix some option inconsistencies.
    if options.target_os in ['nuttx', 'tizenrt']:
        options.buildlib = True
        if not options.sysroot:
            ex.fail('--sysroot needed for nuttx target')

        options.sysroot = fs.abspath(options.sysroot)
        if not fs.exists(options.sysroot):
            ex.fail('NuttX sysroot %s does not exist' % options.sysroot)

    if options.target_arch == 'x86':
        options.target_arch = 'i686'
    if options.target_arch == 'x64':
        options.target_arch = 'x86_64'

    if options.target_os == 'darwin':
        options.no_check_valgrind = True

    if options.target_board in ['rpi2', 'rpi3', 'artik10', 'artik05x']:
        options.no_check_valgrind = True

    # Then add calculated options.
    options.host_tuple = '%s-%s' % (platform.arch(), platform.os())
    options.target_tuple = '%s-%s' % (options.target_arch, options.target_os)

    # Normalize the path of build directory.
    options.builddir = fs.normpath(options.builddir)

    options.build_root = fs.join(path.PROJECT_ROOT,
                                 options.builddir,
                                 options.target_tuple,
                                 options.buildtype)

    cmake_path = fs.join(path.PROJECT_ROOT, 'cmake', 'config', '%s.cmake')
    options.cmake_toolchain_file = cmake_path % options.target_tuple

    # Specify the file of JerryScript profile.
    options.jerry_profile = fs.join(path.JERRY_PROFILE_ROOT,
                                    options.jerry_profile + '.profile')
开发者ID:MoonkiHong,项目名称:iotjs,代码行数:42,代码来源:build.py


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