All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dongxiao Xu <dongxiao.xu@intel.com>
To: bitbake-devel@lists.openembedded.org
Subject: [PATCH 1/3] command.py: Add a hook for config parsing
Date: Thu, 12 Apr 2012 23:46:25 +0800	[thread overview]
Message-ID: <7cacaa562688f1b5bd78f7dc12b1c1d1a70196e2.1334245432.git.dongxiao.xu@intel.com> (raw)
In-Reply-To: <cover.1334245432.git.dongxiao.xu@intel.com>
In-Reply-To: <cover.1334245432.git.dongxiao.xu@intel.com>

To make the UI settings take effect, we need to hook at the end of each
config file parsing and set UI specific values.

Signed-off-by: Richar Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
---
 lib/bb/command.py                    |    7 +++++++
 lib/bb/parse/parse_py/ConfHandler.py |    5 +++++
 2 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/lib/bb/command.py b/lib/bb/command.py
index 73aaca0..fd8912a 100644
--- a/lib/bb/command.py
+++ b/lib/bb/command.py
@@ -179,6 +179,13 @@ class CommandsSync:
         """
         return bb.utils.cpu_count()
 
+    def setConfFilter(self, command, params):
+        """
+        Set the configuration file parsing filter
+        """
+        filterfunc = params[0]
+        bb.parse.parse_py.ConfHandler.confFilters.append(filterfunc)
+
 class CommandsAsync:
     """
     A class of asynchronous commands
diff --git a/lib/bb/parse/parse_py/ConfHandler.py b/lib/bb/parse/parse_py/ConfHandler.py
index fa811f3..f108c24 100644
--- a/lib/bb/parse/parse_py/ConfHandler.py
+++ b/lib/bb/parse/parse_py/ConfHandler.py
@@ -71,6 +71,8 @@ def include(oldfn, fn, lineno, data, error_out):
             raise ParseError("Could not %(error_out)s file %(fn)s" % vars(), oldfn, lineno)
         logger.debug(2, "CONF file '%s' not found", fn)
 
+confFilters = []
+
 def handle(fn, data, include):
     init(data)
 
@@ -107,6 +109,9 @@ def handle(fn, data, include):
     if oldfile:
         data.setVar('FILE', oldfile)
 
+    for f in confFilters:
+        f(fn, data)
+
     return data
 
 def feeder(lineno, s, fn, statements):
-- 
1.7.4.1




  reply	other threads:[~2012-04-12 15:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-12 15:46 [PATCH 0/3][PULL] Hob: Bug fixes Dongxiao Xu
2012-04-12 15:46 ` Dongxiao Xu [this message]
2012-04-13 10:54   ` [PATCH 1/3] command.py: Add a hook for config parsing Richard Purdie
2012-04-12 15:46 ` [PATCH 2/3] Hob: Implement Hob config parse hook Dongxiao Xu
2012-04-12 15:46 ` [PATCH 3/3] Hob: A minor fix on tooltip Dongxiao Xu
2012-04-13 10:44   ` Richard Purdie

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=7cacaa562688f1b5bd78f7dc12b1c1d1a70196e2.1334245432.git.dongxiao.xu@intel.com \
    --to=dongxiao.xu@intel.com \
    --cc=bitbake-devel@lists.openembedded.org \
    /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.