diff options
author | Robert Yang <liezhi.yang@windriver.com> | 2012-05-30 18:19:08 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-05-30 17:18:14 +0100 |
commit | ab10f3da1976581c371c43cdb88f405cf6fbcd95 (patch) | |
tree | 24555a37840223a49445c6c2d1898fc00ae42ff2 | |
parent | 047ad35c0c869883509557aeb982e0b784ad2e71 (diff) | |
download | bitbake-ab10f3da1976581c371c43cdb88f405cf6fbcd95.tar.gz |
HOB: 'str' object has no attribute 'close'
For builddetailspage.py:
The "f" was a stream in the past, it is a string now, so it doesn't
need f.close(), and change its name to "branch".
And we don't need the "2>&1" since bb.process.run() can handle it, it
will raise exception when error occurs, we should handle the exception
ourselves if we want to ignore the error.
For hig.py:
Use bb.process.Popen() since it doesn't need the return value. If we
use bb.process.run(), the parent process will wait for the child process
to terminate to get the result.
[YOCTO #2511]
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rwxr-xr-x | lib/bb/ui/crumbs/builddetailspage.py | 7 | ||||
-rw-r--r-- | lib/bb/ui/crumbs/hig.py | 2 |
2 files changed, 4 insertions, 5 deletions
diff --git a/lib/bb/ui/crumbs/builddetailspage.py b/lib/bb/ui/crumbs/builddetailspage.py index 0741a7ba7..b1afe10bb 100755 --- a/lib/bb/ui/crumbs/builddetailspage.py +++ b/lib/bb/ui/crumbs/builddetailspage.py @@ -98,11 +98,10 @@ class BuildConfigurationTreeView(gtk.TreeView): for path in src_config_info.layers: import os, os.path if os.path.exists(path): - f, errors = bb.process.run('cd %s; git branch 2>&1 | grep "^* " | tr -d "* "' % path) - if f: - branch = f.strip('\n') + branch = bb.process.run('cd %s; git branch | grep "^* " | tr -d "* "' % path)[0] + if branch: + branch = branch.strip('\n') vars.append(self.set_vars("Branch:", branch)) - f.close() break self.set_config_model(vars) diff --git a/lib/bb/ui/crumbs/hig.py b/lib/bb/ui/crumbs/hig.py index 42e88338b..7c9e73fdf 100644 --- a/lib/bb/ui/crumbs/hig.py +++ b/lib/bb/ui/crumbs/hig.py @@ -831,7 +831,7 @@ class DeployImageDialog (CrumbsDialog): cmdline = bb.ui.crumbs.utils.which_terminal() if cmdline: cmdline += "\"sudo dd if=" + self.image_path + " of=" + combo_item + "\"" - bb.process.run(shlex.split(cmdline)) + bb.process.Popen(shlex.split(cmdline)) def update_progress_bar(self, title, fraction, status=None): self.progress_bar.update(fraction) |