本文整理汇总了Python中webkitpy.common.system.path.cygpath函数的典型用法代码示例。如果您正苦于以下问题:Python cygpath函数的具体用法?Python cygpath怎么用?Python cygpath使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cygpath函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: create_debugger_command_file
def create_debugger_command_file(self):
debugger_temp_directory = str(self._filesystem.mkdtemp())
command_file = self._filesystem.join(debugger_temp_directory, "debugger-commands.txt")
commands = ''.join(['.logopen /t "%s\\%s.txt"\n' % (cygpath(self.results_directory()), self.CRASH_LOG_PREFIX),
'.srcpath "%s"\n' % cygpath(self._webkit_finder.webkit_base()),
'!analyze -vv\n',
'~*kpn\n',
'q\n'])
self._filesystem.write_text_file(command_file, commands)
return command_file
示例2: test_stop_cygpath_subprocess
def test_stop_cygpath_subprocess(self):
if sys.platform != 'cygwin':
return
# Call cygpath to ensure the subprocess is running.
path.cygpath("/cygdrive/c/foo.txt")
self.assertTrue(path._CygPath._singleton.is_running())
# Stop it.
path._CygPath.stop_cygpath_subprocess()
# Ensure that it is stopped.
self.assertFalse(path._CygPath._singleton.is_running())
示例3: _command_from_driver_input
def _command_from_driver_input(self, driver_input):
# FIXME: performance tests pass in full URLs instead of test names.
if (
driver_input.test_name.startswith("http://")
or driver_input.test_name.startswith("https://")
or driver_input.test_name == ("about:blank")
):
command = driver_input.test_name
elif self.is_http_test(driver_input.test_name):
command = self.test_to_uri(driver_input.test_name)
else:
command = self._port.abspath_for_test(driver_input.test_name)
if sys.platform == "cygwin":
command = path.cygpath(command)
assert not driver_input.image_hash or driver_input.should_run_pixel_test
# ' is the separator between arguments.
if self._port.supports_per_test_timeout():
command += "'--timeout'%s" % driver_input.timeout
if driver_input.should_run_pixel_test:
command += "'--pixel-test"
if driver_input.image_hash:
command += "'" + driver_input.image_hash
return command + "\n"
示例4: results_directory
def results_directory(self):
"""Absolute path to the place to store the test results (uses --results-directory)."""
if not self._results_directory:
option_val = self.get_option('results_directory') or self.default_results_directory()
self._results_directory = self._filesystem.abspath(option_val)
if sys.platform == 'cygwin':
self._results_directory = cygpath(self._results_directory)
self._abs_results_directory = self._filesystem.abspath(option_val)
return self._results_directory
示例5: setup_crash_log_saving
def setup_crash_log_saving(self):
if '_NT_SYMBOL_PATH' not in os.environ:
_log.warning("The _NT_SYMBOL_PATH environment variable is not set. Crash logs will not be saved.")
return None
ntsd_path = self._ntsd_location()
if not ntsd_path:
_log.warning("Can't find ntsd.exe. Crash logs will not be saved.")
return None
# If we used -c (instead of -cf) we could pass the commands directly on the command line. But
# when the commands include multiple quoted paths (e.g., for .logopen and .srcpath), Windows
# fails to invoke the post-mortem debugger at all (perhaps due to a bug in Windows's command
# line parsing). So we save the commands to a file instead and tell the debugger to execute them
# using -cf.
command_file = self.create_debugger_command_file()
if not command_file:
return None
debugger_options = '"{0}" -p %ld -e %ld -g -noio -lines -cf "{1}"'.format(cygpath(ntsd_path), cygpath(command_file))
registry_settings = {'Debugger': debugger_options, 'Auto': "1"}
for key in registry_settings:
self.previous_debugger_values[key] = self.read_registry_string(key)
self.write_registry_string(key, registry_settings[key])
示例6: _setup_environ_for_driver
def _setup_environ_for_driver(self, environment):
build_root_path = str(self._port._build_path())
# FIXME: DYLD_* variables should be Mac-only. Even iOS Simulator doesn't need them, as LayoutTestRelay is a host binary.
self._append_environment_variable_path(environment, 'DYLD_LIBRARY_PATH', build_root_path)
self._append_environment_variable_path(environment, '__XPC_DYLD_LIBRARY_PATH', build_root_path)
self._append_environment_variable_path(environment, 'DYLD_FRAMEWORK_PATH', build_root_path)
self._append_environment_variable_path(environment, '__XPC_DYLD_FRAMEWORK_PATH', build_root_path)
# Use an isolated temp directory that can be deleted after testing (especially important on Mac, as
# CoreMedia disk cache is in the temp directory).
environment['TMPDIR'] = str(self._driver_tempdir)
environment['DIRHELPER_USER_DIR_SUFFIX'] = self._driver_user_directory_suffix
# Put certain normally persistent files into the temp directory (e.g. IndexedDB storage).
if sys.platform == 'cygwin':
environment['DUMPRENDERTREE_TEMP'] = path.cygpath(str(self._driver_tempdir))
else:
environment['DUMPRENDERTREE_TEMP'] = str(self._driver_tempdir)
environment['LOCAL_RESOURCE_ROOT'] = str(self._port.layout_tests_dir())
environment['ASAN_OPTIONS'] = "allocator_may_return_null=1"
environment['__XPC_ASAN_OPTIONS'] = environment['ASAN_OPTIONS']
if 'WEBKIT_OUTPUTDIR' in os.environ:
environment['WEBKIT_OUTPUTDIR'] = os.environ['WEBKIT_OUTPUTDIR']
if self._profiler:
environment = self._profiler.adjusted_environment(environment)
return environment
示例7: _convert_path
def _convert_path(self, path):
"""Handles filename conversion for subprocess command line args."""
# See note above in diff_image() for why we need this.
if sys.platform == "cygwin":
return cygpath(path)
return path
示例8: _driver_tempdir_for_environment
def _driver_tempdir_for_environment(self):
return cygpath(self._driver_tempdir())