From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6657041487194226688 X-Received: by 2002:a17:906:34c3:: with SMTP id h3mr634253ejb.3.1549991666788; Tue, 12 Feb 2019 09:14:26 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a17:906:c381:: with SMTP id t1ls3446222ejz.5.gmail; Tue, 12 Feb 2019 09:14:26 -0800 (PST) X-Google-Smtp-Source: AHgI3IacXsLm7xqtjQhKjTpkUB2qeNNTzDF4daA9Fom+VDEyQ5u/kH6byOrvbnRrjbRG9V50r7Ig X-Received: by 2002:a17:906:8da:: with SMTP id o26mr634634eje.7.1549991666381; Tue, 12 Feb 2019 09:14:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549991666; cv=none; d=google.com; s=arc-20160816; b=wIkwBYDGRqDWu9llLohEWb5aldnOo2uaP5A3RYMkkuHGzTgB6glXY1nYcZplbNEZnq CZ3Y+Gf+ekVge0m6rk4AaY3WRVurG4dwxz5+e7yqo0xkfrhjKa1aQitgXwnj0FdtK50P WHIlivFPdMXa+mP+jsC3kgg3LLRCsi0fWT0Zvaf28XSjne9LD1xvbs/nkGHNj+B29+yM ycnM35QSJm5qFkXBIrHxPdLwI1xwvjXmcAZBO88h9KJ05kGcTFfp8qUG33w+cceI2b2b seuFh5dns08Wtg+m1XQYWGdwW+meDmpSAHdUmYa6TUePBZBOMtjxSj/puUiolkdk1qBZ kANw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date; bh=0LNqPLtNLccQQ4WqWD7rHqTL2ZwaW1PEQ8ZQ0dIuQSk=; b=f0DJpO+BAZzN4+nKxYCpnRFTg9S1LB4ZbhFQn7Mj2SyprvEq6ktqYUV9dawezhq33G FtcOnX68fEJ2K39I17OlJXQw2fdzTQCOeNoIQzBB6OUIjco9JDuKvHDAdo3HoX1Je6Wx 8iI7E0vPNmOmRiSNVh4HtbfnCu/5El+bAmvP7GEi6fYCuyjJWWRbhN4yEaHgsJnGGnye jmwBQbcMXfZONjmTdYWofjk12LlvU1gFuhwWrkiJ0Qqqx3kJowFLiYwlUUT+MUh1bNmS ICYNoFBZxMjUjD4uR+2fHWGUrMtqLmjSSZJByNgpxBr/f/eUGzxbkcAdt9GreOfA+oHG JN4Q== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 194.138.37.40 as permitted sender) smtp.mailfrom=henning.schild@siemens.com Return-Path: Received: from gecko.sbs.de (gecko.sbs.de. [194.138.37.40]) by gmr-mx.google.com with ESMTPS id s13si82731eja.0.2019.02.12.09.14.26 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Feb 2019 09:14:26 -0800 (PST) Received-SPF: pass (google.com: domain of henning.schild@siemens.com designates 194.138.37.40 as permitted sender) client-ip=194.138.37.40; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 194.138.37.40 as permitted sender) smtp.mailfrom=henning.schild@siemens.com Received: from mail2.sbs.de (mail2.sbs.de [192.129.41.66]) by gecko.sbs.de (8.15.2/8.15.2) with ESMTPS id x1CHEOJd011832 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 12 Feb 2019 18:14:24 +0100 Received: from md1za8fc.ad001.siemens.net ([139.25.0.9]) by mail2.sbs.de (8.15.2/8.15.2) with ESMTP id x1CHEP3m021102; Tue, 12 Feb 2019 18:14:25 +0100 Date: Tue, 12 Feb 2019 18:14:24 +0100 From: Henning Schild To: Harald Seiler Cc: Subject: Re: [PATCH v2 0/5] Python refactoring Message-ID: <20190212181424.17905fdf@md1za8fc.ad001.siemens.net> In-Reply-To: <20190212165637.19970-1-hws@denx.de> References: <20190212165637.19970-1-hws@denx.de> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-TUID: fRnrlDyLUjGy Nice cleanups! Henning On Tue, 12 Feb 2019 17:56:32 +0100 Harald Seiler wrote: > This series contains a number of improvements to python code in isar: > > * All instancess of subprocess.{call,Popen,check_call}() have been > changed to never use `shell=True`. This will hopefully prevent bugs > in the future. > * The use of the % formatter was replaced by other methods, as % was > deprecated because it can behave weirdly. Unfortunately, as we have > to support python back to 3.5, we can not yet make use of f-Strings, > so other options had to be used. I decided to use string > concatenation for simple cases where the use of .format() would have > been too verbose. > * A recursive call in get_image_name was removed in favor of an > imperative code style. This should make the respective function > easier to read. > > Changes in v2: > > * Remove redundant encoding parameter > * Fix formatting > * Refactor a task that I previously missed > * Add a commit for general style fixes > > Harald Seiler (5): > Remove all uses of subprocess.call(shell=True) > Use modern python formatting > image: Remove recursion in get_image_name > wic: Refactor fakeroot script > Fix python style > > .../example-module/example-module.bb | 8 ++- > meta/classes/base.bbclass | 70 > ++++++++++++++-------- > meta/classes/image.bbclass | 22 +++++-- > meta/classes/isar-bootstrap-helper.bbclass | 8 +-- > meta/classes/isar-events.bbclass | 14 ++--- > meta/classes/patch.bbclass | 13 ++-- > meta/classes/wic-img.bbclass | 21 > +++++-- .../isar-bootstrap/isar-bootstrap-host.bb | 9 > ++- .../isar-bootstrap/isar-bootstrap-target.bb | 5 > +- .../recipes-core/isar-bootstrap/isar-bootstrap.inc | 12 ++-- > scripts/wic_fakeroot | 9 +-- 11 files > changed, 120 insertions(+), 71 deletions(-) >