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:23:30 +0100 |
commit | cc3da1236c4f5a26bf2ffd0f0357273f4e070b56 (patch) | |
tree | 43576baca72650b074fed2651f495132686179e4 /bitbake | |
parent | 9b6d3f48d205de9b5744c5448e9e784a526a406d (diff) | |
download | poky-cc3da1236c4f5a26bf2ffd0f0357273f4e070b56.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]
(Bitbake rev: ab10f3da1976581c371c43cdb88f405cf6fbcd95)
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rwxr-xr-x | bitbake/lib/bb/ui/crumbs/builddetailspage.py | 7 | ||||
-rw-r--r-- | bitbake/lib/bb/ui/crumbs/hig.py | 2 |
2 files changed, 4 insertions, 5 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/builddetailspage.py b/bitbake/lib/bb/ui/crumbs/builddetailspage.py index 0741a7ba73..b1afe10bbc 100755 --- a/bitbake/lib/bb/ui/crumbs/builddetailspage.py +++ b/bitbake/lib/bb/ui/crumbs/builddetailspage.py | |||
@@ -98,11 +98,10 @@ class BuildConfigurationTreeView(gtk.TreeView): | |||
98 | for path in src_config_info.layers: | 98 | for path in src_config_info.layers: |
99 | import os, os.path | 99 | import os, os.path |
100 | if os.path.exists(path): | 100 | if os.path.exists(path): |
101 | f, errors = bb.process.run('cd %s; git branch 2>&1 | grep "^* " | tr -d "* "' % path) | 101 | branch = bb.process.run('cd %s; git branch | grep "^* " | tr -d "* "' % path)[0] |
102 | if f: | 102 | if branch: |
103 | branch = f.strip('\n') | 103 | branch = branch.strip('\n') |
104 | vars.append(self.set_vars("Branch:", branch)) | 104 | vars.append(self.set_vars("Branch:", branch)) |
105 | f.close() | ||
106 | break | 105 | break |
107 | 106 | ||
108 | self.set_config_model(vars) | 107 | self.set_config_model(vars) |
diff --git a/bitbake/lib/bb/ui/crumbs/hig.py b/bitbake/lib/bb/ui/crumbs/hig.py index 42e88338bb..7c9e73fdf9 100644 --- a/bitbake/lib/bb/ui/crumbs/hig.py +++ b/bitbake/lib/bb/ui/crumbs/hig.py | |||
@@ -831,7 +831,7 @@ class DeployImageDialog (CrumbsDialog): | |||
831 | cmdline = bb.ui.crumbs.utils.which_terminal() | 831 | cmdline = bb.ui.crumbs.utils.which_terminal() |
832 | if cmdline: | 832 | if cmdline: |
833 | cmdline += "\"sudo dd if=" + self.image_path + " of=" + combo_item + "\"" | 833 | cmdline += "\"sudo dd if=" + self.image_path + " of=" + combo_item + "\"" |
834 | bb.process.run(shlex.split(cmdline)) | 834 | bb.process.Popen(shlex.split(cmdline)) |
835 | 835 | ||
836 | def update_progress_bar(self, title, fraction, status=None): | 836 | def update_progress_bar(self, title, fraction, status=None): |
837 | self.progress_bar.update(fraction) | 837 | self.progress_bar.update(fraction) |