diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-05-20 11:49:34 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-06-02 08:24:00 +0100 |
commit | 8587bce564f715e46e7317218b5c190813d3a939 (patch) | |
tree | d67f45ca7d88f1ea1dcfc436a82763fa6c39a686 /meta/lib | |
parent | a7309d5790f5dac46e84d3c14959943eb2496fda (diff) | |
download | poky-8587bce564f715e46e7317218b5c190813d3a939.tar.gz |
classes/lib: Update to match python3 iter requirements
python3 standardises its use of iteration operations. Update
the code to match the for python3 requires.
(From OE-Core rev: 2476bdcbef591e951d11d57d53f1315848758571)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r-- | meta/lib/oe/buildhistory_analysis.py | 4 | ||||
-rw-r--r-- | meta/lib/oe/copy_buildsystem.py | 2 | ||||
-rw-r--r-- | meta/lib/oe/data.py | 2 | ||||
-rw-r--r-- | meta/lib/oe/recipeutils.py | 8 | ||||
-rw-r--r-- | meta/lib/oe/sstatesig.py | 2 | ||||
-rw-r--r-- | meta/lib/oeqa/selftest/devtool.py | 2 | ||||
-rw-r--r-- | meta/lib/oeqa/selftest/sstatetests.py | 4 | ||||
-rw-r--r-- | meta/lib/oeqa/utils/decorators.py | 2 |
8 files changed, 13 insertions, 13 deletions
diff --git a/meta/lib/oe/buildhistory_analysis.py b/meta/lib/oe/buildhistory_analysis.py index 5395c768a3..0dcd49f4f1 100644 --- a/meta/lib/oe/buildhistory_analysis.py +++ b/meta/lib/oe/buildhistory_analysis.py | |||
@@ -62,7 +62,7 @@ class ChangeRecord: | |||
62 | 62 | ||
63 | def pkglist_combine(depver): | 63 | def pkglist_combine(depver): |
64 | pkglist = [] | 64 | pkglist = [] |
65 | for k,v in depver.iteritems(): | 65 | for k,v in depver.items(): |
66 | if v: | 66 | if v: |
67 | pkglist.append("%s (%s)" % (k,v)) | 67 | pkglist.append("%s (%s)" % (k,v)) |
68 | else: | 68 | else: |
@@ -220,7 +220,7 @@ def compare_file_lists(alines, blines): | |||
220 | adict = file_list_to_dict(alines) | 220 | adict = file_list_to_dict(alines) |
221 | bdict = file_list_to_dict(blines) | 221 | bdict = file_list_to_dict(blines) |
222 | filechanges = [] | 222 | filechanges = [] |
223 | for path, splitv in adict.iteritems(): | 223 | for path, splitv in adict.items(): |
224 | newsplitv = bdict.pop(path, None) | 224 | newsplitv = bdict.pop(path, None) |
225 | if newsplitv: | 225 | if newsplitv: |
226 | # Check type | 226 | # Check type |
diff --git a/meta/lib/oe/copy_buildsystem.py b/meta/lib/oe/copy_buildsystem.py index 7b9a0ee065..0589b7f045 100644 --- a/meta/lib/oe/copy_buildsystem.py +++ b/meta/lib/oe/copy_buildsystem.py | |||
@@ -124,7 +124,7 @@ class BuildSystem(object): | |||
124 | def generate_locked_sigs(sigfile, d): | 124 | def generate_locked_sigs(sigfile, d): |
125 | bb.utils.mkdirhier(os.path.dirname(sigfile)) | 125 | bb.utils.mkdirhier(os.path.dirname(sigfile)) |
126 | depd = d.getVar('BB_TASKDEPDATA', False) | 126 | depd = d.getVar('BB_TASKDEPDATA', False) |
127 | tasks = ['%s.%s' % (v[2], v[1]) for v in depd.itervalues()] | 127 | tasks = ['%s.%s' % (v[2], v[1]) for v in depd.values()] |
128 | bb.parse.siggen.dump_lockedsigs(sigfile, tasks) | 128 | bb.parse.siggen.dump_lockedsigs(sigfile, tasks) |
129 | 129 | ||
130 | def prune_lockedsigs(excluded_tasks, excluded_targets, lockedsigs, pruned_output): | 130 | def prune_lockedsigs(excluded_tasks, excluded_targets, lockedsigs, pruned_output): |
diff --git a/meta/lib/oe/data.py b/meta/lib/oe/data.py index 23a9067a60..ee48950a82 100644 --- a/meta/lib/oe/data.py +++ b/meta/lib/oe/data.py | |||
@@ -7,7 +7,7 @@ def typed_value(key, d): | |||
7 | flags = d.getVarFlags(key) | 7 | flags = d.getVarFlags(key) |
8 | if flags is not None: | 8 | if flags is not None: |
9 | flags = dict((flag, d.expand(value)) | 9 | flags = dict((flag, d.expand(value)) |
10 | for flag, value in flags.iteritems()) | 10 | for flag, value in list(flags.items())) |
11 | else: | 11 | else: |
12 | flags = {} | 12 | flags = {} |
13 | 13 | ||
diff --git a/meta/lib/oe/recipeutils.py b/meta/lib/oe/recipeutils.py index 3e17873fd8..b437720fe7 100644 --- a/meta/lib/oe/recipeutils.py +++ b/meta/lib/oe/recipeutils.py | |||
@@ -336,7 +336,7 @@ def patch_recipe(d, fn, varvalues, patch=False, relpath=''): | |||
336 | varfiles = get_var_files(fn, varlist, d) | 336 | varfiles = get_var_files(fn, varlist, d) |
337 | locs = localise_file_vars(fn, varfiles, varlist) | 337 | locs = localise_file_vars(fn, varfiles, varlist) |
338 | patches = [] | 338 | patches = [] |
339 | for f,v in locs.iteritems(): | 339 | for f,v in locs.items(): |
340 | vals = {k: varvalues[k] for k in v} | 340 | vals = {k: varvalues[k] for k in v} |
341 | patchdata = patch_recipe_file(f, vals, patch, relpath) | 341 | patchdata = patch_recipe_file(f, vals, patch, relpath) |
342 | if patch: | 342 | if patch: |
@@ -554,7 +554,7 @@ def bbappend_recipe(rd, destlayerdir, srcfiles, install=None, wildcardver=False, | |||
554 | bbappendlines = [] | 554 | bbappendlines = [] |
555 | if extralines: | 555 | if extralines: |
556 | if isinstance(extralines, dict): | 556 | if isinstance(extralines, dict): |
557 | for name, value in extralines.iteritems(): | 557 | for name, value in extralines.items(): |
558 | bbappendlines.append((name, '=', value)) | 558 | bbappendlines.append((name, '=', value)) |
559 | else: | 559 | else: |
560 | # Do our best to split it | 560 | # Do our best to split it |
@@ -594,7 +594,7 @@ def bbappend_recipe(rd, destlayerdir, srcfiles, install=None, wildcardver=False, | |||
594 | copyfiles = {} | 594 | copyfiles = {} |
595 | if srcfiles: | 595 | if srcfiles: |
596 | instfunclines = [] | 596 | instfunclines = [] |
597 | for newfile, origsrcfile in srcfiles.iteritems(): | 597 | for newfile, origsrcfile in srcfiles.items(): |
598 | srcfile = origsrcfile | 598 | srcfile = origsrcfile |
599 | srcurientry = None | 599 | srcurientry = None |
600 | if not srcfile: | 600 | if not srcfile: |
@@ -717,7 +717,7 @@ def bbappend_recipe(rd, destlayerdir, srcfiles, install=None, wildcardver=False, | |||
717 | if copyfiles: | 717 | if copyfiles: |
718 | if machine: | 718 | if machine: |
719 | destsubdir = os.path.join(destsubdir, machine) | 719 | destsubdir = os.path.join(destsubdir, machine) |
720 | for newfile, srcfile in copyfiles.iteritems(): | 720 | for newfile, srcfile in copyfiles.items(): |
721 | filedest = os.path.join(appenddir, destsubdir, os.path.basename(srcfile)) | 721 | filedest = os.path.join(appenddir, destsubdir, os.path.basename(srcfile)) |
722 | if os.path.abspath(newfile) != os.path.abspath(filedest): | 722 | if os.path.abspath(newfile) != os.path.abspath(filedest): |
723 | bb.note('Copying %s to %s' % (newfile, filedest)) | 723 | bb.note('Copying %s to %s' % (newfile, filedest)) |
diff --git a/meta/lib/oe/sstatesig.py b/meta/lib/oe/sstatesig.py index 01dce660cf..500122d461 100644 --- a/meta/lib/oe/sstatesig.py +++ b/meta/lib/oe/sstatesig.py | |||
@@ -220,7 +220,7 @@ class SignatureGeneratorOEBasicHash(bb.siggen.SignatureGeneratorBasicHash): | |||
220 | for task in range(len(sq_fn)): | 220 | for task in range(len(sq_fn)): |
221 | if task not in ret: | 221 | if task not in ret: |
222 | for pn in self.lockedsigs: | 222 | for pn in self.lockedsigs: |
223 | if sq_hash[task] in self.lockedsigs[pn].itervalues(): | 223 | if sq_hash[task] in iter(self.lockedsigs[pn].values()): |
224 | if sq_task[task] == 'do_shared_workdir': | 224 | if sq_task[task] == 'do_shared_workdir': |
225 | continue | 225 | continue |
226 | sstate_missing_msgs.append("Locked sig is set for %s:%s (%s) yet not in sstate cache?" | 226 | sstate_missing_msgs.append("Locked sig is set for %s:%s (%s) yet not in sstate cache?" |
diff --git a/meta/lib/oeqa/selftest/devtool.py b/meta/lib/oeqa/selftest/devtool.py index b64f9b3e76..6d2417ee4f 100644 --- a/meta/lib/oeqa/selftest/devtool.py +++ b/meta/lib/oeqa/selftest/devtool.py | |||
@@ -50,7 +50,7 @@ class DevtoolBase(oeSelfTest): | |||
50 | 50 | ||
51 | 51 | ||
52 | missingvars = {} | 52 | missingvars = {} |
53 | for var, value in checkvars.iteritems(): | 53 | for var, value in checkvars.items(): |
54 | if value is not None: | 54 | if value is not None: |
55 | missingvars[var] = value | 55 | missingvars[var] = value |
56 | self.assertEqual(missingvars, {}, 'Some expected variables not found in recipe: %s' % checkvars) | 56 | self.assertEqual(missingvars, {}, 'Some expected variables not found in recipe: %s' % checkvars) |
diff --git a/meta/lib/oeqa/selftest/sstatetests.py b/meta/lib/oeqa/selftest/sstatetests.py index a1e5d33580..cc64c6cb68 100644 --- a/meta/lib/oeqa/selftest/sstatetests.py +++ b/meta/lib/oeqa/selftest/sstatetests.py | |||
@@ -445,14 +445,14 @@ http_proxy = "http://example.com/" | |||
445 | files1 = get_files(topdir + "/tmp-sstatesamehash/stamps/") | 445 | files1 = get_files(topdir + "/tmp-sstatesamehash/stamps/") |
446 | files2 = get_files(topdir + "/tmp-sstatesamehash2/stamps/") | 446 | files2 = get_files(topdir + "/tmp-sstatesamehash2/stamps/") |
447 | # Remove items that are identical in both sets | 447 | # Remove items that are identical in both sets |
448 | for k,v in files1.viewitems() & files2.viewitems(): | 448 | for k,v in files1.items() & files2.items(): |
449 | del files1[k] | 449 | del files1[k] |
450 | del files2[k] | 450 | del files2[k] |
451 | if not files1 and not files2: | 451 | if not files1 and not files2: |
452 | # No changes, so we're done | 452 | # No changes, so we're done |
453 | return | 453 | return |
454 | 454 | ||
455 | for k in files1.viewkeys() | files2.viewkeys(): | 455 | for k in files1.keys() | files2.keys(): |
456 | if k in files1 and k in files2: | 456 | if k in files1 and k in files2: |
457 | print("%s differs:" % k) | 457 | print("%s differs:" % k) |
458 | print(subprocess.check_output(("bitbake-diffsigs", | 458 | print(subprocess.check_output(("bitbake-diffsigs", |
diff --git a/meta/lib/oeqa/utils/decorators.py b/meta/lib/oeqa/utils/decorators.py index d52f326f1a..6fb09db417 100644 --- a/meta/lib/oeqa/utils/decorators.py +++ b/meta/lib/oeqa/utils/decorators.py | |||
@@ -215,7 +215,7 @@ def tag(*args, **kwargs): | |||
215 | def wrap_ob(ob): | 215 | def wrap_ob(ob): |
216 | for name in args: | 216 | for name in args: |
217 | setattr(ob, __tag_prefix + name, True) | 217 | setattr(ob, __tag_prefix + name, True) |
218 | for name, value in kwargs.iteritems(): | 218 | for name, value in kwargs.items(): |
219 | setattr(ob, __tag_prefix + name, value) | 219 | setattr(ob, __tag_prefix + name, value) |
220 | return ob | 220 | return ob |
221 | return wrap_ob | 221 | return wrap_ob |