summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Larson <chris_larson@mentor.com>2010-12-17 12:13:28 -0700
committerChris Larson <chris_larson@mentor.com>2010-12-17 12:13:54 -0700
commitdc7893d0da5834d7a02be4314cefee0d1f9e3b48 (patch)
tree604210db1743657ddd35ece8388d32a7479b5c3a
parentdc5a5c39291ec223cd761dce59d29eee7316cb70 (diff)
downloadbitbake-dc7893d0da5834d7a02be4314cefee0d1f9e3b48.tar.gz
Revert "build: stop injecting os/bb into __builtins__"
Temporary revert, will resurrect. This reverts commit 566657c13de3fefb5043b71de953fb805799da95.
-rw-r--r--lib/bb/build.py12
-rw-r--r--lib/bb/ui/uihelper.py12
2 files changed, 20 insertions, 4 deletions
diff --git a/lib/bb/build.py b/lib/bb/build.py
index 5f3986b1e..6a796ba3b 100644
--- a/lib/bb/build.py
+++ b/lib/bb/build.py
@@ -25,14 +25,15 @@
#
#Based on functions from the base bb module, Copyright 2003 Holger Schurig
-import logging
import os
import sys
+import logging
import bb
import bb.msg
import bb.utils
import bb.process
-from bb import data, event, utils
+from contextlib import nested
+from bb import data, event, mkdirhier, utils
bblogger = logging.getLogger('BitBake')
logger = logging.getLogger('BitBake.Build')
@@ -40,6 +41,13 @@ logger = logging.getLogger('BitBake.Build')
NULL = open('/dev/null', 'r+')
+# When we execute a python function we'd like certain things
+# in all namespaces, hence we add them to __builtins__
+# If we do not do this and use the exec globals, they will
+# not be available to subfunctions.
+__builtins__['bb'] = bb
+__builtins__['os'] = os
+
class FuncFailed(Exception):
def __init__(self, name, logfile = None):
self.logfile = logfile
diff --git a/lib/bb/ui/uihelper.py b/lib/bb/ui/uihelper.py
index 617d60db8..698de03f0 100644
--- a/lib/bb/ui/uihelper.py
+++ b/lib/bb/ui/uihelper.py
@@ -17,8 +17,6 @@
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-import bb.build
-
class BBUIHelper:
def __init__(self):
self.needUpdate = False
@@ -37,6 +35,16 @@ class BBUIHelper:
self.failed_tasks.append( { 'title' : "%s %s" % (event._package, event._task)})
self.needUpdate = True
+ # Add runqueue event handling
+ #if isinstance(event, bb.runqueue.runQueueTaskCompleted):
+ # a = 1
+ #if isinstance(event, bb.runqueue.runQueueTaskStarted):
+ # a = 1
+ #if isinstance(event, bb.runqueue.runQueueTaskFailed):
+ # a = 1
+ #if isinstance(event, bb.runqueue.runQueueExitWait):
+ # a = 1
+
def getTasks(self):
self.needUpdate = False
return (self.running_tasks, self.failed_tasks)