代码拉取完成,页面将自动刷新
同步操作将从 OpenHarmony/third_party_wayland_standard 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#!/usr/bin/env python
# Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Script to run wayland-scaner for wayland_protocol.gni.
"""
from __future__ import print_function
import argparse
import os.path
import subprocess
import sys
def generate_code(wayland_scanner_cmd, code_type, path_in, path_out):
"""
[generate code]
Args:
wayland_scanner_cmd : wayland_scanner_cmd
code_type : type
path_in : path_in
path_out : path_out
Returns:
none: none
Raises:
IOError: wayland-scanner returned an error
"""
ret = subprocess.call([wayland_scanner_cmd, code_type, path_in, path_out])
if ret != 0:
raise RuntimeError("wayland-scanner returned an error: %d" % ret)
def main():
"""
[main]
Args: NA
Returns: NA
Raises: NA
"""
parser = argparse.ArgumentParser()
parser.add_argument("--cmd", help="wayland-scanner command to execute")
parser.add_argument("--src-root", help="Root source directory")
parser.add_argument("--root-gen-dir", help="Directory for generated files")
parser.add_argument("protocols", nargs="+",
help="Input protocol file paths relative to src root.")
options = parser.parse_args()
cmd = os.path.realpath(options.cmd)
src_root = options.src_root
root_gen_dir = options.root_gen_dir
protocols = options.protocols
version = subprocess.check_output([cmd, '--version'], \
stderr=subprocess.STDOUT)
# The version is of the form "wayland-scanner 1.18.0\n"
ver = version.decode().strip().split(' ')[1].split('.')
version = tuple([int(x) for x in ver])
for protocol in protocols:
protocol_path = os.path.join(src_root, protocol)
protocol_without_extension = protocol.rsplit(".", 1)[0]
out_base_name = os.path.join(root_gen_dir, protocol_without_extension)
code_cmd = 'private-code' if version > (1, 14, 90) else 'code'
generate_code(cmd, code_cmd, protocol_path,
out_base_name + "-protocol.c")
generate_code(cmd, "client-header", protocol_path,
out_base_name + "-client-protocol.h")
generate_code(cmd, "server-header", protocol_path,
out_base_name + "-server-protocol.h")
if __name__ == "__main__":
try:
main()
except RuntimeError as error:
print(error, file=sys.stderr)
sys.exit(1)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。