All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: Cristiana Voicu <cristiana.voicu@intel.com>
Cc: bitbake-devel@lists.openembedded.org
Subject: Re: [PATCH] hob/imageconfigurationpage: a 'hob-image' appears listed in the base image combo box
Date: Mon, 08 Oct 2012 10:47:25 +0100	[thread overview]
Message-ID: <1349689645.15658.108.camel@ted> (raw)
In-Reply-To: <1349686879-25765-1-git-send-email-cristiana.voicu@intel.com>

On Mon, 2012-10-08 at 12:01 +0300, Cristiana Voicu wrote:
> -remove this image from image combo box
> 
> [YOCTO #3230]
> Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
> ---
>  bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py |    5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py b/bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py
> index e1c7a67..32e5c45 100644
> --- a/bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py
> +++ b/bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py
> @@ -368,6 +368,7 @@ class ImageConfigurationPage (HobPage):
>          if self.builder.parameters.image_black_pattern:
>              for i in self.builder.parameters.image_black_pattern.split():
>                  black_pattern.append(re.compile(i))
> +        black_pattern.append("hob-image")
>  
>          it = image_model.get_iter_first()
>          self._image_combo_disconnect_signal()
> @@ -386,13 +387,13 @@ class ImageConfigurationPage (HobPage):
>              if black_pattern:
>                  allow = True
>                  for pattern in black_pattern:
> -                    if pattern.search(image_name):
> +                    if image_name in pattern:
>                          allow = False
>                          break
>              elif white_pattern:
>                  allow = False
>                  for pattern in white_pattern:
> -                    if pattern.search(image_name):
> +                    if image_name in pattern:
>                          allow = True
>                          break
>              else:

>>> import re
>>> foo=re.compile("bar.*")
>>> if "bar1" in foo:
...     print "ok"
... 
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: argument of type '_sre.SRE_Pattern' is not iterable

which is effectively what you're doing above. You probably want
something like:

+        black_pattern.append(re.compile("hob-image"))

and leave the .search() calls in?

Cheers,

Richard






      reply	other threads:[~2012-10-08 10:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-08  9:01 [PATCH] hob/imageconfigurationpage: a 'hob-image' appears listed in the base image combo box Cristiana Voicu
2012-10-08  9:47 ` Richard Purdie [this message]

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=1349689645.15658.108.camel@ted \
    --to=richard.purdie@linuxfoundation.org \
    --cc=bitbake-devel@lists.openembedded.org \
    --cc=cristiana.voicu@intel.com \
    /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 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.