diff options
author | Ed Bartosh <ed.bartosh@linux.intel.com> | 2016-05-18 21:39:44 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-06-02 08:10:03 +0100 |
commit | 25d4d8274bac696a484f83d7f3ada778cf95f4d0 (patch) | |
tree | 626c84b436b57344bbb512870f4d2acd9f5b1195 /scripts/contrib | |
parent | 210e290c9251839dc74e3aabdcea3655dd707a50 (diff) | |
download | openembedded-core-25d4d8274bac696a484f83d7f3ada778cf95f4d0.tar.gz openembedded-core-25d4d8274bac696a484f83d7f3ada778cf95f4d0.tar.bz2 openembedded-core-25d4d8274bac696a484f83d7f3ada778cf95f4d0.zip |
scripts: Fix deprecated dict methods for python3
Replaced iteritems -> items, itervalues -> values,
iterkeys -> keys or 'in'
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Diffstat (limited to 'scripts/contrib')
-rwxr-xr-x | scripts/contrib/bbvars.py | 10 | ||||
-rwxr-xr-x | scripts/contrib/list-packageconfig-flags.py | 4 | ||||
-rwxr-xr-x | scripts/contrib/python/generate-manifest-2.7.py | 4 | ||||
-rwxr-xr-x | scripts/contrib/python/generate-manifest-3.5.py | 4 |
4 files changed, 11 insertions, 11 deletions
diff --git a/scripts/contrib/bbvars.py b/scripts/contrib/bbvars.py index 04f5023969..6f479355eb 100755 --- a/scripts/contrib/bbvars.py +++ b/scripts/contrib/bbvars.py @@ -59,8 +59,8 @@ def collect_bbvars(metadir): for root,dirs,files in os.walk(metadir): for name in files: if name.find(".bb") >= 0: - for key in recipe_bbvars(os.path.join(root,name)).iterkeys(): - if bbvars.has_key(key): + for key in recipe_bbvars(os.path.join(root,name)).keys(): + if key in bbvars: bbvars[key] = bbvars[key] + 1 else: bbvars[key] = 1 @@ -155,15 +155,15 @@ def main(): # Collect all the variable names from the recipes in the metadirs for m in metadirs: - for key,cnt in collect_bbvars(m).iteritems(): - if bbvars.has_key(key): + for key,cnt in collect_bbvars(m).items(): + if key in bbvars: bbvars[key] = bbvars[key] + cnt else: bbvars[key] = cnt # Check each var for documentation varlen = 0 - for v in bbvars.iterkeys(): + for v in bbvars.keys(): if len(v) > varlen: varlen = len(v) if not bbvar_is_documented(v, docfiles): diff --git a/scripts/contrib/list-packageconfig-flags.py b/scripts/contrib/list-packageconfig-flags.py index 5dfe796c0a..22d0c4904d 100755 --- a/scripts/contrib/list-packageconfig-flags.py +++ b/scripts/contrib/list-packageconfig-flags.py @@ -86,7 +86,7 @@ def collect_flags(pkg_dict): ''' Collect available PACKAGECONFIG flags and all affected pkgs ''' # flag_dict = {'flag': ['pkg1', 'pkg2',...]} flag_dict = {} - for pkgname, flaglist in pkg_dict.iteritems(): + for pkgname, flaglist in pkg_dict.items(): for flag in flaglist: if flag in flag_dict: flag_dict[flag].append(pkgname) @@ -132,7 +132,7 @@ def display_all(data_dict): packageconfig = 'None' print('PACKAGECONFIG %s' % packageconfig) - for flag,flag_val in data_dict[fn].getVarFlags("PACKAGECONFIG").iteritems(): + for flag,flag_val in data_dict[fn].getVarFlags("PACKAGECONFIG").items(): if flag == "doc": continue print('PACKAGECONFIG[%s] %s' % (flag, flag_val)) diff --git a/scripts/contrib/python/generate-manifest-2.7.py b/scripts/contrib/python/generate-manifest-2.7.py index 48be3a6d74..f2ecf8d3f5 100755 --- a/scripts/contrib/python/generate-manifest-2.7.py +++ b/scripts/contrib/python/generate-manifest-2.7.py @@ -97,7 +97,7 @@ class MakefileMaker: # generate package variables # - for name, data in sorted(self.packages.iteritems()): + for name, data in sorted(self.packages.items()): desc, deps, files = data # @@ -130,7 +130,7 @@ class MakefileMaker: self.out( 'SUMMARY_${PN}-modules="All Python modules"' ) line = 'RDEPENDS_${PN}-modules="' - for name, data in sorted(self.packages.iteritems()): + for name, data in sorted(self.packages.items()): if name not in ['${PN}-dev', '${PN}-distutils-staticdev']: line += "%s " % name diff --git a/scripts/contrib/python/generate-manifest-3.5.py b/scripts/contrib/python/generate-manifest-3.5.py index a7b38d202a..41f209b17f 100755 --- a/scripts/contrib/python/generate-manifest-3.5.py +++ b/scripts/contrib/python/generate-manifest-3.5.py @@ -100,7 +100,7 @@ class MakefileMaker: # generate package variables # - for name, data in sorted(self.packages.iteritems()): + for name, data in sorted(self.packages.items()): desc, deps, files = data # @@ -133,7 +133,7 @@ class MakefileMaker: self.out( 'SUMMARY_${PN}-modules="All Python modules"' ) line = 'RDEPENDS_${PN}-modules="' - for name, data in sorted(self.packages.iteritems()): + for name, data in sorted(self.packages.items()): if name not in ['${PN}-dev', '${PN}-distutils-staticdev']: line += "%s " % name |