From patchwork Sat Dec 5 10:30:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 10566 X-Patchwork-Delegate: paul.elder@ideasonboard.com Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id F2CA4BDB20 for ; Sat, 5 Dec 2020 10:31:23 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id C3C7E635F4; Sat, 5 Dec 2020 11:31:23 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="PbFDKlt2"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id AC39D63600 for ; Sat, 5 Dec 2020 11:31:22 +0100 (CET) Received: from pyrite.rasen.tech (unknown [IPv6:2400:4051:61:600:2c71:1b79:d06d:5032]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id DF9E62A4; Sat, 5 Dec 2020 11:31:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1607164282; bh=JRCCfZdRsX7oYSklQ2hLa4U0BHk3+ERyiyYV78dlU38=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PbFDKlt2RINs+BsSUYj3zYCvEj0M36+Fuzf05KHoO14M6bNhLFTHODMKTG7z0bpRN V322uvxrF6DozfsuAktcaacrO0A6mmf8L2iUUmDg4PkCEdb17rcaG+OBb+O4Io3/ij u1HnVUMIT2bp6sKmpkRvrmXq8+54FzbEhx8dq4Yc= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Sat, 5 Dec 2020 19:30:46 +0900 Message-Id: <20201205103106.242080-4-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20201205103106.242080-1-paul.elder@ideasonboard.com> References: <20201205103106.242080-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v5 03/23] utils: ipc: add parser script X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" 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 Reviewed-by: Laurent Pinchart Reviewed-by: Niklas Söderlund --- 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 +# +# 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:])