utils: ipc: add parser script
On some systems, python2 might still be the default python. Enforce python3 by wrapping the mojo parser script in a python3 script. This also has the benefit of not modifying mojo. Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
This commit is contained in:
parent
2ad8768fd6
commit
6072ca395a
1 changed files with 20 additions and 0 deletions
20
utils/ipc/parser.py
Executable file
20
utils/ipc/parser.py
Executable file
|
@ -0,0 +1,20 @@
|
||||||
|
#!/usr/bin/env python3
|
||||||
|
# SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
# Copyright (C) 2020, Google Inc.
|
||||||
|
#
|
||||||
|
# Author: Paul Elder <paul.elder@ideasonboard.com>
|
||||||
|
#
|
||||||
|
# parser.py - Run mojo parser with python3
|
||||||
|
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
|
||||||
|
# TODO set sys.pycache_prefix for >= python3.8
|
||||||
|
sys.dont_write_bytecode = True
|
||||||
|
|
||||||
|
# Make sure that mojom_parser.py can import mojom
|
||||||
|
sys.path.append(f'{os.path.dirname(__file__)}/mojo/public/tools/mojom')
|
||||||
|
|
||||||
|
import mojo.public.tools.mojom.mojom_parser as parser
|
||||||
|
|
||||||
|
parser.Run(sys.argv[1:])
|
Loading…
Add table
Add a link
Reference in a new issue