]> code.ossystems Code Review - openembedded-core.git/commitdiff
Import fixups
authorChris Larson <chris_larson@mentor.com>
Thu, 8 Apr 2010 17:22:29 +0000 (10:22 -0700)
committerRichard Purdie <rpurdie@linux.intel.com>
Fri, 2 Jul 2010 14:41:32 +0000 (15:41 +0100)
(Bitbake rev: 4fa052f426e3205ebace713eaa22deddc0420e8a)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
15 files changed:
bitbake/bin/bitbake
bitbake/lib/bb/__init__.py
bitbake/lib/bb/build.py
bitbake/lib/bb/cache.py
bitbake/lib/bb/cooker.py
bitbake/lib/bb/data_smart.py
bitbake/lib/bb/event.py
bitbake/lib/bb/fetch/repo.py
bitbake/lib/bb/msg.py
bitbake/lib/bb/parse/ast.py
bitbake/lib/bb/parse/parse_py/BBHandler.py
bitbake/lib/bb/parse/parse_py/ConfHandler.py
bitbake/lib/bb/runqueue.py
bitbake/lib/bb/shell.py
bitbake/lib/bb/utils.py

index ba84d2de7fc654a6805a8a816f3a54630b2cd2a0..3400dae6e64f6e861f8ef9f4e9eddbc84a796ce7 100755 (executable)
@@ -22,7 +22,7 @@
 # with this program; if not, write to the Free Software Foundation, Inc.,
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
-import sys, os, getopt, re, time, optparse, xmlrpclib
+import sys, os, optparse
 sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(sys.argv[0])),
                                 'lib'))
 
index 3ba6beb2c13517cfd119ef2bec82f2fd90cc3c3a..7e2933eb891d89da49383d3fac21cbbfa98d790e 100644 (file)
@@ -53,7 +53,8 @@ __all__ = [
     "providers",
  ]
 
-import sys, os, types, re, string
+import os
+import bb.msg
 
 if "BBDEBUG" in os.environ:
     level = int(os.environ["BBDEBUG"])
index 7ca1663b7c9da3b9f90b30fb25c2345ff3b8ba02..1882733a5f4a7194508cff91c00b5f26471f8608 100644 (file)
@@ -200,7 +200,6 @@ def exec_func(func, d, dirs = None):
 
 def exec_func_python(func, d, runfile, logfile):
     """Execute a python BB 'function'"""
-    import re, os
 
     bbfile = bb.data.getVar('FILE', d, 1)
     tmp  = "def " + func + "(d):\n%s" % data.getVar(func, d)
index 300acc5fc6be0d5eca4e66190ee88193934b23a3..0d165aec2f2eb305a4ca93ec6e40cc8f1dd3e62c 100644 (file)
@@ -28,7 +28,7 @@
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 
-import os, re
+import os
 import bb.data
 import bb.utils
 
@@ -452,14 +452,13 @@ class Cache:
         Return the data and whether parsing resulted in the file being skipped
         """
 
-        import bb
-        from bb import utils, data, parse, debug, event, fatal
+        from bb import data, parse
 
         # expand tmpdir to include this topdir
         data.setVar('TMPDIR', data.getVar('TMPDIR', config, 1) or "", config)
         bbfile_loc = os.path.abspath(os.path.dirname(bbfile))
         oldpath = os.path.abspath(os.getcwd())
-        if bb.parse.cached_mtime_noerror(bbfile_loc):
+        if parse.cached_mtime_noerror(bbfile_loc):
             os.chdir(bbfile_loc)
         bb_data = data.init_db(config)
         try:
index 743e4be06ba3a27de2ad6465c60a941b99ac4fc5..6090efcad97db24137fae016661de19f2ebcc7b5 100644 (file)
 # with this program; if not, write to the Free Software Foundation, Inc.,
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
-import sys, os, getopt, glob, copy, os.path, re, time
+import sys, os, glob, os.path, re, time
 import bb
-from bb import utils, data, parse, event, cache, providers, taskdata, runqueue
-from bb import command
-import itertools, sre_constants
+from bb import utils, data, parse, event, cache, providers, taskdata, command, runqueue
+import sre_constants
 
 class MultipleMatches(Exception):
     """
index 5ff0b37bfccd3d4e06554eed8bd9873438e8a987..7f46b4abb929490554041969abb879f4d4f2f119 100644 (file)
@@ -28,11 +28,10 @@ BitBake build tools.
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 # Based on functions from the base bb module, Copyright 2003 Holger Schurig
 
-import copy, os, re, sys, time, types
+import copy, re, sys, types
 import bb
-from bb   import utils, methodpool
+from bb   import utils
 from bb.COW  import COWDictBase
-from new  import classobj
 
 
 __setvar_keyword__ = ["_append", "_prepend"]
index 456b89caff3ce5c57c2efc2cb187d92aea336bf6..f0690b4f2b405a39069d7043482bcb255373b466 100644 (file)
@@ -22,7 +22,7 @@ BitBake build tools.
 # with this program; if not, write to the Free Software Foundation, Inc.,
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
-import os, re, sys
+import os, sys
 import warnings
 import bb.utils
 import pickle
index 34c32fe0bbca6f311e9613cd5a6e4893c686fc5a..883310b019f97bba089546b0b29dc35fd2bdecee 100644 (file)
@@ -23,11 +23,10 @@ BitBake "Fetch" repo (git) implementation
 # with this program; if not, write to the Free Software Foundation, Inc.,
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
-import os, re
+import os
 import bb
 from   bb    import data
 from   bb.fetch import Fetch
-from   bb.fetch import FetchError
 from   bb.fetch import runfetchcmd
 
 class Repo(Fetch):
index 17d1a0852b236724ba0c384e729ee9e748b55452..788e1dddf7027aedccc6e54d21c596ae4d8e7774 100644 (file)
@@ -22,9 +22,10 @@ Message handling infrastructure for bitbake
 # with this program; if not, write to the Free Software Foundation, Inc.,
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
-import sys, bb
+import sys
 import collections
-from bb import event
+import bb
+import bb.event
 
 debug_level = collections.defaultdict(lambda: 0)
 verbose = False
@@ -54,7 +55,7 @@ class MsgBase(bb.event.Event):
 
     def __init__(self, msg):
         self._message = msg
-        event.Event.__init__(self)
+        bb.event.Event.__init__(self)
 
 class MsgDebug(MsgBase):
     """Debug Message"""
index 6d4f285626c59b8a0616d3f94917f2507d4a1572..a586c5cde1d7cbf0619c1d63d11d2a2c5184d494 100644 (file)
@@ -22,6 +22,7 @@
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 import bb, re, string
+from bb import methodpool
 from itertools import chain
 
 __word__ = re.compile(r"\S+")
index f9f185ff717b884a7ffd0dbbb396b5170557d92e..c053b5bfdf898c5a91f7e60d37ff11bbbc2f8ebe 100644 (file)
 # with this program; if not, write to the Free Software Foundation, Inc.,
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
-import re, bb, os, sys, time, string
+import re, bb, os
 import bb.fetch, bb.build, bb.utils
-from bb import data, fetch
+from bb import data
 
 from ConfHandler import include, init
-from bb.parse import ParseError, resolve_file, ast
+from bb.parse import resolve_file, ast
 
 # For compatibility
 from bb.parse import vars_from_file
index e50acbe5e18d13d8a3fa99a992e925271ad7fdf1..8e17182ba7f948b9e14ef473f90e04a9c927c1ce 100644 (file)
@@ -24,7 +24,7 @@
 # with this program; if not, write to the Free Software Foundation, Inc.,
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
-import re, bb.data, os, sys
+import re, bb.data, os
 import bb.utils
 from bb.parse import ParseError, resolve_file, ast
 
index 2ecfd094693355c613ff3a712804219c22ada554..9881315b9df15e956dbe9b7d686f6f4a22d16e68 100644 (file)
@@ -22,8 +22,8 @@ Handles preparation and execution of a queue of tasks
 # with this program; if not, write to the Free Software Foundation, Inc.,
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
-from bb import msg, data, event, mkdirhier, utils
 import bb, os, sys
+from bb import msg, data, event
 import signal
 import stat
 import fcntl
index 512bcbf07a74cb0f28e7764fce50c2eb91b80802..71dd599ed6c35a81eba6973e895ca7a6eacbd14d 100644 (file)
@@ -56,8 +56,8 @@ try:
     set
 except NameError:
     from sets import Set as set
-import sys, os, readline, socket, httplib, urllib, commands, popen2, copy, shlex, Queue, fnmatch
-from bb import data, parse, build, fatal, cache, taskdata, runqueue, providers as Providers
+import sys, os, readline, socket, httplib, urllib, commands, popen2, shlex, Queue, fnmatch
+from bb import data, parse, build, cache, taskdata, runqueue, providers as Providers
 
 __version__ = "0.5.3.1"
 __credits__ = """BitBake Shell Version %s (C) 2005 Michael 'Mickey' Lauer <mickey@Vanille.de>
index 93c158c60448091ca4bc139fe39963c716c1f777..132d5e56b25330c4c6540d8026f0536cad39abe6 100644 (file)
@@ -19,7 +19,11 @@ BitBake Utility Functions
 # with this program; if not, write to the Free Software Foundation, Inc.,
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
-import re, fcntl, os, types, bb, string, stat, shutil, time
+import re, fcntl, os, types, string, stat, shutil, time
+import sys
+import bb
+import errno
+import bb.msg
 from commands import getstatusoutput
 
 # Version comparison
@@ -287,8 +291,6 @@ def _print_trace(body, line):
     """
     Print the Environment of a Text Body
     """
-    import bb
-
     # print the environment of the method
     bb.msg.error(bb.msg.domain.Util, "Printing the environment of the function")
     min_line = max(1, line-4)
@@ -305,8 +307,6 @@ def better_compile(text, file, realfile, mode = "exec"):
     try:
         return compile(text, file, mode)
     except Exception, e:
-        import bb, sys
-
         # split the text into lines again
         body = text.split('\n')
         bb.msg.error(bb.msg.domain.Util, "Error in compiling python function in: ", realfile)
@@ -324,7 +324,7 @@ def better_exec(code, context, text, realfile):
     print the lines that are responsible for the
     error.
     """
-    import bb, sys
+    import bb.parse
     try:
         exec code in _context, context
     except:
@@ -361,7 +361,6 @@ def lockfile(name):
     """
     path = os.path.dirname(name)
     if not os.path.isdir(path):
-        import bb, sys
         bb.msg.error(bb.msg.domain.Util, "Error, lockfile path does not exist!: %s" % path)
         sys.exit(1)
 
@@ -467,8 +466,6 @@ def filter_environment(good_vars):
     are not known and may influence the build in a negative way.
     """
 
-    import bb
-
     removed_vars = []
     for key in os.environ.keys():
         if key in good_vars:
@@ -509,7 +506,7 @@ def build_environment(d):
     """
     Build an environment from all exported variables.
     """
-    import bb
+    import bb.data
     for var in bb.data.keys(d):
         export = bb.data.getVarFlag(var, "export", d)
         if export:
@@ -550,9 +547,8 @@ def mkdirhier(dir):
         os.makedirs(dir)
         bb.msg.debug(2, bb.msg.domain.Util, "created " + dir)
     except OSError, e:
-        if e.errno != 17: raise e
-
-import stat
+        if e.errno != errno.EEXIST:
+            raise e
 
 def movefile(src, dest, newmtime = None, sstat = None):
     """Moves a file from src to dest, preserving all permissions and
@@ -603,7 +599,6 @@ def movefile(src, dest, newmtime = None, sstat = None):
             ret = os.rename(src, dest)
             renamefailed = 0
         except Exception, e:
-            import errno
             if e[0] != errno.EXDEV:
                 # Some random error.
                 print "movefile: Failed to move", src, "to", dest, e