From ecbd5ca720ce28284280dc60013b3f60e9dd934f Mon Sep 17 00:00:00 2001 From: Chris Larson Date: Sun, 20 Jun 2010 12:07:34 -0700 Subject: 3.0 prep Signed-off-by: Richard Purdie --- bitbake/lib/bb/fetch/__init__.py | 25 +++++++++++++------------ bitbake/lib/bb/fetch/perforce.py | 1 + bitbake/lib/bb/parse/ast.py | 2 ++ bitbake/lib/bb/parse/parse_py/BBHandler.py | 9 +++++---- bitbake/lib/bb/parse/parse_py/__init__.py | 8 +++++--- bitbake/lib/bb/ui/ncurses.py | 8 +++++--- 6 files changed, 31 insertions(+), 22 deletions(-) (limited to 'bitbake/lib') diff --git a/bitbake/lib/bb/fetch/__init__.py b/bitbake/lib/bb/fetch/__init__.py index 651fea8873..31b9653793 100644 --- a/bitbake/lib/bb/fetch/__init__.py +++ b/bitbake/lib/bb/fetch/__init__.py @@ -24,6 +24,7 @@ BitBake build tools. # # Based on functions from the base bb module, Copyright 2003 Holger Schurig +from __future__ import absolute_import from __future__ import print_function import os, re import bb @@ -727,18 +728,18 @@ class Fetch(object): key = self._revision_key(url, ud, d) return "%s-%s" % (key, bb.data.getVar("PN", d, True) or "") -import cvs -import git -import local -import svn -import wget -import svk -import ssh -import perforce -import bzr -import hg -import osc -import repo +from . import cvs +from . import git +from . import local +from . import svn +from . import wget +from . import svk +from . import ssh +from . import perforce +from . import bzr +from . import hg +from . import osc +from . import repo methods.append(local.Local()) methods.append(wget.Wget()) diff --git a/bitbake/lib/bb/fetch/perforce.py b/bitbake/lib/bb/fetch/perforce.py index 5b6c601876..1c74cff349 100644 --- a/bitbake/lib/bb/fetch/perforce.py +++ b/bitbake/lib/bb/fetch/perforce.py @@ -25,6 +25,7 @@ BitBake build tools. # # Based on functions from the base bb module, Copyright 2003 Holger Schurig +from future_builtins import zip import os import bb from bb import data diff --git a/bitbake/lib/bb/parse/ast.py b/bitbake/lib/bb/parse/ast.py index 02d682d88f..dae2e11154 100644 --- a/bitbake/lib/bb/parse/ast.py +++ b/bitbake/lib/bb/parse/ast.py @@ -21,6 +21,8 @@ # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +from __future__ import absolute_import +from future_builtins import filter import bb, re, string from bb import methodpool import itertools diff --git a/bitbake/lib/bb/parse/parse_py/BBHandler.py b/bitbake/lib/bb/parse/parse_py/BBHandler.py index 9708416a0a..bb56174881 100644 --- a/bitbake/lib/bb/parse/parse_py/BBHandler.py +++ b/bitbake/lib/bb/parse/parse_py/BBHandler.py @@ -25,12 +25,14 @@ # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +from __future__ import absolute_import import re, bb, os import bb.fetch, bb.build, bb.utils from bb import data -from ConfHandler import include, init -from bb.parse import resolve_file, ast +from . import ConfHandler +from .. import resolve_file, ast +from .ConfHandler import include, init # For compatibility bb.deprecate_import(__name__, "bb.parse", ["vars_from_file"]) @@ -231,10 +233,9 @@ def feeder(lineno, s, fn, root, statements): ast.handleInherit(statements, m) return - from bb.parse import ConfHandler return ConfHandler.feeder(lineno, s, fn, statements) # Add us to the handlers list -from bb.parse import handlers +from .. import handlers handlers.append({'supports': supports, 'handle': handle, 'init': init}) del handlers diff --git a/bitbake/lib/bb/parse/parse_py/__init__.py b/bitbake/lib/bb/parse/parse_py/__init__.py index a900101784..3e658d0de9 100644 --- a/bitbake/lib/bb/parse/parse_py/__init__.py +++ b/bitbake/lib/bb/parse/parse_py/__init__.py @@ -25,7 +25,9 @@ File parsers for the 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 -__version__ = '1.0' -import ConfHandler -import BBHandler +from __future__ import absolute_import +from . import ConfHandler +from . import BBHandler + +__version__ = '1.0' diff --git a/bitbake/lib/bb/ui/ncurses.py b/bitbake/lib/bb/ui/ncurses.py index 81dcb1998c..3fed4c58a8 100644 --- a/bitbake/lib/bb/ui/ncurses.py +++ b/bitbake/lib/bb/ui/ncurses.py @@ -44,6 +44,8 @@ """ +from __future__ import division + import os, sys, curses, itertools, time import bb import xmlrpclib @@ -199,8 +201,8 @@ class NCursesUI: main_left = 0 main_top = 0 - main_height = ( height / 3 * 2 ) - main_width = ( width / 3 ) * 2 + main_height = ( height // 3 * 2 ) + main_width = ( width // 3 ) * 2 clo_left = main_left clo_top = main_top + main_height clo_height = height - main_height - main_top - 1 @@ -266,7 +268,7 @@ class NCursesUI: mw.appendText("Parsing finished. %d cached, %d parsed, %d skipped, %d masked." % ( event.cached, event.parsed, event.skipped, event.masked )) else: - mw.setStatus("Parsing: %s (%04d/%04d) [%2d %%]" % ( next(parsespin), x, y, x*100/y ) ) + mw.setStatus("Parsing: %s (%04d/%04d) [%2d %%]" % ( next(parsespin), x, y, x*100//y ) ) # if isinstance(event, bb.build.TaskFailed): # if event.logfile: # if data.getVar("BBINCLUDELOGS", d): -- cgit v1.2.3