From patchwork Thu Jun 14 10:10:57 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [bitbake-devel,2/3] ui/crumbs/hig.py: simplify subprocess call Date: Thu, 14 Jun 2012 10:10:57 -0000 From: Kang Kai X-Patchwork-Id: 29817 Message-Id: <6fd8d4b280166137d3ef31185eeaa4f4760c5ae9.1339653356.git.kai.kang@windriver.com> To: Cc: Zhenfeng.Zhao@windriver.com According to Darren's suggestion, subprocess.call() will wait until the subprocess complete. So simplify the code, use subprocess.call() to wait command complete. Signed-off-by: Kang Kai --- bitbake/lib/bb/ui/crumbs/hig.py | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bitbake/lib/bb/ui/crumbs/hig.py b/bitbake/lib/bb/ui/crumbs/hig.py index 0c3f56c..b586b6c 100644 --- a/bitbake/lib/bb/ui/crumbs/hig.py +++ b/bitbake/lib/bb/ui/crumbs/hig.py @@ -27,6 +27,7 @@ import hashlib import os import re import shlex +import subprocess from bb.ui.crumbs.hobcolor import HobColors from bb.ui.crumbs.hobwidget import hcc, hic, HobViewTable, HobInfoButton, HobButton, HobAltButton, HobIconChecker from bb.ui.crumbs.progressbar import HobProgressBar @@ -871,8 +872,7 @@ class DeployImageDialog (CrumbsDialog): tmpname = os.tmpnam() cmdline += "\"sudo dd if=" + self.image_path + \ " of=" + combo_item + "; echo $? > " + tmpname + "\"" - deploy_process = bb.process.Popen(shlex.split(cmdline)) - deploy_process.wait() + subprocess.call(shlex.split(cmdline)) # if file tmpname not exists, that means there is something wrong with xterm # user can get the error message from xterm so no more warning need.