From: Harald Seiler <hws@denx.de>
To: isar-users@googlegroups.com
Subject: [PATCH 0/4] Python refactoring
Date: Tue, 12 Feb 2019 10:20:42 +0100 [thread overview]
Message-ID: <20190212092046.6508-1-hws@denx.de> (raw)
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.
Harald Seiler (4):
Remove all uses of subprocess.call(shell=True)
Use modern python formatting
image: Remove recursion in get_image_name
wic: Refactor fakeroot script
meta/classes/base.bbclass | 47 +++++++++++++++-------
meta/classes/image.bbclass | 22 +++++++---
meta/classes/isar-bootstrap-helper.bbclass | 9 ++---
meta/classes/isar-events.bbclass | 13 +++---
meta/classes/patch.bbclass | 16 ++++++--
meta/classes/wic-img.bbclass | 21 +++++++---
.../recipes-core/isar-bootstrap/isar-bootstrap.inc | 12 +++---
scripts/wic_fakeroot | 9 ++---
8 files changed, 95 insertions(+), 54 deletions(-)
--
2.14.1
next reply other threads:[~2019-02-12 9:20 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-12 9:20 Harald Seiler [this message]
2019-02-12 9:20 ` [PATCH 1/4] Remove all uses of subprocess.call(shell=True) Harald Seiler
2019-02-12 9:51 ` Claudius Heine
2019-02-12 9:20 ` [PATCH 2/4] Use modern python formatting Harald Seiler
2019-02-12 9:20 ` [PATCH 3/4] image: Remove recursion in get_image_name Harald Seiler
2019-02-12 9:20 ` [PATCH 4/4] wic: Refactor fakeroot script Harald Seiler
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190212092046.6508-1-hws@denx.de \
--to=hws@denx.de \
--cc=isar-users@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox