[libcamera-devel] [PATCH v5 03/23] utils: ipc: add parser script
Niklas Söderlund
niklas.soderlund at ragnatech.se
Fri Dec 18 16:57:04 CET 2020
Hi Paul,
Thanks for your patch.
On 2020-12-05 19:30:46 +0900, Paul Elder wrote:
> 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 at ideasonboard.com>
> Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund at ragnatech.se>
>
> ---
> No change in v5
>
> No change in v4
>
> New in v3
> ---
> utils/ipc/parser.py | 20 ++++++++++++++++++++
> 1 file changed, 20 insertions(+)
> create mode 100755 utils/ipc/parser.py
>
> diff --git a/utils/ipc/parser.py b/utils/ipc/parser.py
> new file mode 100755
> index 00000000..f46820fa
> --- /dev/null
> +++ b/utils/ipc/parser.py
> @@ -0,0 +1,20 @@
> +#!/usr/bin/env python3
> +# SPDX-License-Identifier: BSD-3-Clause
> +# Copyright (C) 2020, Google Inc.
> +#
> +# Author: Paul Elder <paul.elder at 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:])
> --
> 2.27.0
>
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel at lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel
--
Regards,
Niklas Söderlund
More information about the libcamera-devel
mailing list