From patchwork Thu Oct 31 13:42:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1187471 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="BILReq2d"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 473mkn0PByz9sP6 for ; Fri, 1 Nov 2019 00:44:00 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id B28EEC21F79; Thu, 31 Oct 2019 13:43:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H2, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id C2129C21F37; Thu, 31 Oct 2019 13:43:39 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id BF33EC21E49; Thu, 31 Oct 2019 13:43:36 +0000 (UTC) Received: from mail-il1-f178.google.com (mail-il1-f178.google.com [209.85.166.178]) by lists.denx.de (Postfix) with ESMTPS id 90060C21F2F for ; Thu, 31 Oct 2019 13:43:35 +0000 (UTC) Received: by mail-il1-f178.google.com with SMTP id s75so5427309ilc.3 for ; Thu, 31 Oct 2019 06:43:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=I5oZa/FZu0jZ+e/qcSKV4vadEE8dO1yp9C/EYl/SlYg=; b=BILReq2dlSyvaIrMX4dSwIeqvEFSAOnwaaDk10jRU9lUnqeCKjCq6hhljxL2gza/Tx rSy7zogVZg/s5DAmBvDa+sCzZulQTP3qMirXxN4QPwg3eC0845BjdQYmBNncJeinUsVD Uoo9R+T524JrP3gDQ2aBIdCDlf53x6wnq2mjg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=I5oZa/FZu0jZ+e/qcSKV4vadEE8dO1yp9C/EYl/SlYg=; b=GQTP6rleal1/CsN1092HDoeH/BHAZEq0hTJ8OjB+BGrXs4P0Xq8hsTI9ykMRRDEyzY /4N0uTKx0aEaRAB1839XPwR2Rmdd+dEa3V8+hO2WfwmuYxciiTXQJBUKguju9HOEYDTS H2UJRzKrcb++XQkcA5aac3tpjayVt1iXp1nuhsgARe19umoUgLkbkH1f1gPXbWhF/eIj UN8OPYcbxGMYqYiDYQ/Bf/2hLCKJL/rT+8JFliCbvMgwcsS7drJj+ixaED2uLm6aiC5w RNrmP03odYr20/srX5awYnq2fapZpy+n79/Aj7oDssLbyd6r0MDi2UnyJxDHCZMnut77 3Sbg== X-Gm-Message-State: APjAAAXqQQHDGI1Y4yGKdxaC1go9fWJCgwBWy6H3R/36IyDdICvwvuTc ysjxNyY1GHGJExcLC/Uz0ovhNSuyPHFjQw== X-Google-Smtp-Source: APXvYqz8z2ljg5H8g4ap84YCD5/oP18nrHFYUoUH2ke6b5QgDPZYQUAJRN1aEg0SDarZB1uiwUXzjQ== X-Received: by 2002:a92:458b:: with SMTP id z11mr5050608ilj.216.1572529414361; Thu, 31 Oct 2019 06:43:34 -0700 (PDT) Received: from kiwi.bld.corp.google.com ([2620:15c:183:0:8223:87c:a681:66aa]) by smtp.gmail.com with ESMTPSA id s70sm539612ili.13.2019.10.31.06.43.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Oct 2019 06:43:33 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Date: Thu, 31 Oct 2019 07:42:58 -0600 Message-Id: <20191031134310.3072-9-sjg@chromium.org> X-Mailer: git-send-email 2.24.0.rc0.303.g954a862665-goog In-Reply-To: <20191031134310.3072-1-sjg@chromium.org> References: <20191031134310.3072-1-sjg@chromium.org> MIME-Version: 1.0 Cc: Tom Rini Subject: [U-Boot] [PATCH v2 09/17] rkmux: Convert to Python 3 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Convert this tool to Python 3 and make it use that, to meet the 2020 deadline. Signed-off-by: Simon Glass Signed-off-by: Simon Glass --- Changes in v2: None tools/rkmux.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tools/rkmux.py b/tools/rkmux.py index 11c192a073..1226ee201c 100755 --- a/tools/rkmux.py +++ b/tools/rkmux.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python3 # Script to create enums from datasheet register tables # @@ -43,8 +43,8 @@ class RegField: self.desc.append(desc) def Show(self): - print self - print + print(self) + print() self.__init__() def __str__(self): @@ -65,11 +65,11 @@ class Printer: self.output_footer() def output_header(self): - print '/* %s */' % self.name - print 'enum {' + print('/* %s */' % self.name) + print('enum {') def output_footer(self): - print '};'; + print('};'); def output_regfield(self, regfield): lines = regfield.desc @@ -97,7 +97,7 @@ class Printer: self.first = False self.output_header() else: - print + print() out_enum(field, 'shift', bit_low) out_enum(field, 'mask', mask) next_val = -1 @@ -175,7 +175,7 @@ def out_enum(field, suffix, value, skip_val=False): val_str = '%d' % value str += '%s= %s' % ('\t' * tabs, val_str) - print '\t%s,' % str + print('\t%s,' % str) # Process a CSV file, e.g. from tabula def process_csv(name, fd):