本文整理汇总了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"
示例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')