All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] HOB: 'str' object has no attribute 'close'
@ 2012-05-30 10:19 Robert Yang
  2012-05-30 10:19 ` [PATCH 1/1] " Robert Yang
  2012-05-30 16:18 ` [PATCH 0/1] " Richard Purdie
  0 siblings, 2 replies; 3+ messages in thread
From: Robert Yang @ 2012-05-30 10:19 UTC (permalink / raw)
  To: bitbake-devel; +Cc: Zhenfeng.Zhao

Hi Shane,
  The "run qemu" and "deploy image" works correctly now, and doesn't hang.

// Robert

The following changes since commit f28209d9d3c67203a2c7a2b25cacfe31643d1bfa:

  cooker.py: terminate the Parser processes (2012-05-25 11:39:33 +0100)

are available in the git repository at:
  git://git.pokylinux.org/poky-contrib robert/hob
  http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=robert/hob

Robert Yang (1):
  HOB: 'str' object has no attribute 'close'

 bitbake/lib/bb/ui/crumbs/builddetailspage.py |    7 +++----
 bitbake/lib/bb/ui/crumbs/hig.py              |    2 +-
 2 files changed, 4 insertions(+), 5 deletions(-)




^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/1] HOB: 'str' object has no attribute 'close'
  2012-05-30 10:19 [PATCH 0/1] HOB: 'str' object has no attribute 'close' Robert Yang
@ 2012-05-30 10:19 ` Robert Yang
  2012-05-30 16:18 ` [PATCH 0/1] " Richard Purdie
  1 sibling, 0 replies; 3+ messages in thread
From: Robert Yang @ 2012-05-30 10:19 UTC (permalink / raw)
  To: bitbake-devel; +Cc: Zhenfeng.Zhao

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>
---
 bitbake/lib/bb/ui/crumbs/builddetailspage.py |    7 +++----
 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 0741a7b..b1afe10 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):
         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/bitbake/lib/bb/ui/crumbs/hig.py b/bitbake/lib/bb/ui/crumbs/hig.py
index 38f890b..17b9408 100644
--- a/bitbake/lib/bb/ui/crumbs/hig.py
+++ b/bitbake/lib/bb/ui/crumbs/hig.py
@@ -829,7 +829,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)
-- 
1.7.1




^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 0/1] HOB: 'str' object has no attribute 'close'
  2012-05-30 10:19 [PATCH 0/1] HOB: 'str' object has no attribute 'close' Robert Yang
  2012-05-30 10:19 ` [PATCH 1/1] " Robert Yang
@ 2012-05-30 16:18 ` Richard Purdie
  1 sibling, 0 replies; 3+ messages in thread
From: Richard Purdie @ 2012-05-30 16:18 UTC (permalink / raw)
  To: Robert Yang; +Cc: bitbake-devel, Zhenfeng.Zhao

On Wed, 2012-05-30 at 18:19 +0800, Robert Yang wrote:
> Hi Shane,
>   The "run qemu" and "deploy image" works correctly now, and doesn't hang.
> 
> // Robert
> 
> The following changes since commit f28209d9d3c67203a2c7a2b25cacfe31643d1bfa:
> 
>   cooker.py: terminate the Parser processes (2012-05-25 11:39:33 +0100)
> 
> are available in the git repository at:
>   git://git.pokylinux.org/poky-contrib robert/hob
>   http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=robert/hob
> 
> Robert Yang (1):
>   HOB: 'str' object has no attribute 'close'

Merged to master, thanks.

Richard




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-05-30 16:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-30 10:19 [PATCH 0/1] HOB: 'str' object has no attribute 'close' Robert Yang
2012-05-30 10:19 ` [PATCH 1/1] " Robert Yang
2012-05-30 16:18 ` [PATCH 0/1] " Richard Purdie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.