def py_execute(command, check_exit_code=True, shell=False, timeout=None, cwd=None, env=None, stdin=None, stdout=None, stderr=None, creationflags=0, wait=True, process_progress_listener=None, close_fds=False): """ Executes a command with the arcadia python :param command: command to pass to python :param check_exit_code: will raise ExecutionError if the command exits with non zero code :param shell: use shell to run the command :param timeout: execution timeout :param cwd: working directory :param env: command environment :param stdin: command stdin :param stdout: command stdout :param stderr: command stderr :param creationflags: command creation flags :param wait: should wait until the command finishes :param process_progress_listener=object that is polled while execution is in progress :return: Execution object """ if isinstance(command, types.StringTypes): command = [command] command = [runtime.python_path()] + command if shell: command = " ".join(command) return execute(**locals())
def py_execute( command, check_exit_code=True, shell=False, timeout=None, cwd=None, env=None, stdin=None, stdout=None, stderr=None, creationflags=0, wait=True, process_progress_listener=None, close_fds=False ): """ Executes a command with the arcadia python :param command: command to pass to python :param check_exit_code: will raise ExecutionError if the command exits with non zero code :param shell: use shell to run the command :param timeout: execution timeout :param cwd: working directory :param env: command environment :param stdin: command stdin :param stdout: command stdout :param stderr: command stderr :param creationflags: command creation flags :param wait: should wait until the command finishes :param process_progress_listener=object that is polled while execution is in progress :return: Execution object """ if isinstance(command, types.StringTypes): command = [command] command = [runtime.python_path()] + command if shell: command = " ".join(command) return execute(**locals())
def backtrace_to_html(bt_filename, output): with open(output, "w") as afile: res = process.execute([runtime.python_path(), runtime.source_path("devtools/coredump_filter/core_proc.py"), bt_filename], check_exit_code=False, check_sanitizer=False, stdout=afile) if res.exit_code != 0: with open(output, "a") as afile: afile.write("\n") afile.write(res.std_err)