summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Larson <chris_larson@mentor.com>2010-12-17 08:28:25 -0700
committerChris Larson <chris_larson@mentor.com>2010-12-18 10:50:22 -0700
commit4988caec915305b8a27b997f54fbcb3a46b4102d (patch)
tree3f82cb84176fbf4a79e95082432cabaf8da3f080
parentc3aec3e887d32ab361e5b6d864679adb135b5786 (diff)
downloadbitbake-4988caec915305b8a27b997f54fbcb3a46b4102d.tar.gz
build: stop injecting os/bb into __builtins__
For one, we should be able to avoid this via _context in bb.utils. For two, __builtins__ only has to exist for CPython, so this causes problems running bitbake under other python implementations (though we could change to doing setattr()s against the __builtin__ module, let's avoid this instead). Signed-off-by: Chris Larson <chris_larson@mentor.com>
-rw-r--r--lib/bb/build.py12
-rw-r--r--lib/bb/ui/uihelper.py12
2 files changed, 4 insertions, 20 deletions
diff --git a/lib/bb/build.py b/lib/bb/build.py
index e91895302..76362c10d 100644
--- a/lib/bb/build.py
+++ b/lib/bb/build.py
@@ -25,15 +25,14 @@
#
#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 contextlib import nested
-from bb import data, event, mkdirhier, utils
+from bb import data, event, utils
bblogger = logging.getLogger('BitBake')
logger = logging.getLogger('BitBake.Build')
@@ -41,13 +40,6 @@ 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 698de03f0..617d60db8 100644
--- a/lib/bb/ui/uihelper.py
+++ b/lib/bb/ui/uihelper.py
@@ -17,6 +17,8 @@
# 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
@@ -35,16 +37,6 @@ 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)