From patchwork Thu Feb 11 07:17:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 11215 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 BE228BD162 for ; Thu, 11 Feb 2021 07:18:28 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 8BFE661642; Thu, 11 Feb 2021 08:18:28 +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="L2Jf5E5K"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id A070861639 for ; Thu, 11 Feb 2021 08:18:26 +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 869DF99D; Thu, 11 Feb 2021 08:18:24 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1613027906; bh=lCa8iePEID+f9tZOciS5l1Ul+OTnowZG9aotVg2FBcs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=L2Jf5E5KfcQCFoL4DN0Wbd0ZbN8D3LwlldwfMY6kWAxt6RNiUK/EFjeJku5c3XhwE lbzZ41w2WOCZbw37fn5s7LPxFOmdxupWDWx10tvpXnSk4Hg6vq39H+AaMXgXSInQu7 qENOC3qGAcOQn7vqm+JWGaUGBIrD7pwk+u8yoTwI= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Thu, 11 Feb 2021 16:17:59 +0900 Message-Id: <20210211071805.34963-5-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210211071805.34963-1-paul.elder@ideasonboard.com> References: <20210211071805.34963-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v7 04/10] 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 v7 No change in v6 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:])