From: Ed Bartosh <ed.bartosh@linux.intel.com>
To: openembedded-core@lists.openembedded.org
Subject: [wic][PATCH 8/9] wic: get rid of set_size and set_source_file setters
Date: Thu, 14 Jan 2016 14:12:58 +0200 [thread overview]
Message-ID: <2bad6e86b3bd5ad53f08575d84174d624b7f3235.1452766193.git.ed.bartosh@linux.intel.com> (raw)
In-Reply-To: <cover.1452766193.git.ed.bartosh@linux.intel.com>
In-Reply-To: <cover.1452766193.git.ed.bartosh@linux.intel.com>
Used size and source_file attributes instead of using
setters. It's more pythonic, clear an consistent.
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
---
scripts/lib/wic/plugins/source/bootimg-efi.py | 4 ++--
scripts/lib/wic/plugins/source/bootimg-pcbios.py | 4 ++--
scripts/lib/wic/plugins/source/isoimage-isohybrid.py | 6 +++---
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/scripts/lib/wic/plugins/source/bootimg-efi.py b/scripts/lib/wic/plugins/source/bootimg-efi.py
index 35afa30..8bfa3a9 100644
--- a/scripts/lib/wic/plugins/source/bootimg-efi.py
+++ b/scripts/lib/wic/plugins/source/bootimg-efi.py
@@ -235,5 +235,5 @@ class BootimgEFIPlugin(SourcePlugin):
out = exec_cmd(du_cmd)
bootimg_size = out.split()[0]
- part.set_size(bootimg_size)
- part.set_source_file(bootimg)
+ part.size = bootimg_size
+ part.source_file = bootimg
diff --git a/scripts/lib/wic/plugins/source/bootimg-pcbios.py b/scripts/lib/wic/plugins/source/bootimg-pcbios.py
index 255684b..e84bddf 100644
--- a/scripts/lib/wic/plugins/source/bootimg-pcbios.py
+++ b/scripts/lib/wic/plugins/source/bootimg-pcbios.py
@@ -205,7 +205,7 @@ class BootimgPcbiosPlugin(SourcePlugin):
out = exec_cmd(du_cmd)
bootimg_size = out.split()[0]
- part.set_size(bootimg_size)
- part.set_source_file(bootimg)
+ part.size = int(out.split()[0])
+ part.source_file = bootimg
diff --git a/scripts/lib/wic/plugins/source/isoimage-isohybrid.py b/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
index b5ca4d3..daefff3 100644
--- a/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
+++ b/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
@@ -302,7 +302,7 @@ class IsoImagePlugin(SourcePlugin):
# which contains rootfs
du_cmd = "du -bks %s" % rootfs_dir
out = exec_cmd(du_cmd)
- part.set_size(int(out.split()[0]))
+ part.size = int(out.split()[0])
part.extra_space = 0
part.overhead_factor = 1.2
part.prepare_rootfs(cr_workdir, oe_builddir, rootfs_dir, \
@@ -502,8 +502,8 @@ class IsoImagePlugin(SourcePlugin):
out = exec_cmd(du_cmd)
isoimg_size = int(out.split()[0])
- part.set_size(isoimg_size)
- part.set_source_file(iso_img)
+ part.size = isoimg_size
+ part.source_file = iso_img
@classmethod
def do_install_disk(cls, disk, disk_name, creator, workdir, oe_builddir,
--
2.1.4
next prev parent reply other threads:[~2016-01-14 14:15 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-14 12:12 [wic][PATCH 0/9] Reimplement kickstart parser Ed Bartosh
2016-01-14 12:12 ` [wic][PATCH 1/9] wic: add partition module Ed Bartosh
2016-01-14 12:12 ` [wic][PATCH 2/9] wic: add kickstart parser module Ed Bartosh
2016-01-14 12:12 ` [wic][PATCH 3/9] wic: use new kickstart parser Ed Bartosh
2016-01-14 12:12 ` [wic][PATCH 4/9] wic: remove pykickstart code Ed Bartosh
2016-01-14 12:12 ` [wic][PATCH 5/9] wic: adjust code for new data structure Ed Bartosh
2016-01-14 12:12 ` [wic][PATCH 6/9] wic: get rid of get_timeout getter Ed Bartosh
2016-01-14 12:12 ` [wic][PATCH 7/9] wic: get rid of get_rootfs and set_rootfs Ed Bartosh
2016-01-14 12:12 ` Ed Bartosh [this message]
2016-01-14 12:12 ` [wic][PATCH 9/9] wic: get rid of 2 getters Ed Bartosh
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=2bad6e86b3bd5ad53f08575d84174d624b7f3235.1452766193.git.ed.bartosh@linux.intel.com \
--to=ed.bartosh@linux.intel.com \
--cc=openembedded-core@lists.openembedded.org \
/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