From 6907b88a99468f88e6ba2ca479d419dcdf921131 Mon Sep 17 00:00:00 2001 From: Arfrever Frehtes Taifersar Arahesis Date: Mon, 21 Sep 2009 16:07:07 +0000 Subject: Use dict.(keys|values|items)() instead of dict.(iterkeys|itervalues|iteritems)() for compatibility with Python 3. (2to3-3.1 -f dict -nw ${FILES}) svn path=/main/trunk/; revision=14327 --- bin/egencache | 6 +++--- bin/emaint | 4 ++-- bin/glsa-check | 2 +- bin/portageq | 4 ++-- bin/quickpkg | 2 +- bin/repoman | 18 +++++++++--------- 6 files changed, 18 insertions(+), 18 deletions(-) (limited to 'bin') diff --git a/bin/egencache b/bin/egencache index 3af060ef8..5c59e6dd0 100755 --- a/bin/egencache +++ b/bin/egencache @@ -168,7 +168,7 @@ class GenCache(object): # mtime on the ebuild (and the corresponding cache entry). # See bug #139134. max_mtime = sc.mtime - for ec, (loc, ec_mtime) in metadata['_eclasses_'].iteritems(): + for ec, (loc, ec_mtime) in metadata['_eclasses_'].items(): if max_mtime < ec_mtime: max_mtime = ec_mtime if max_mtime == sc.mtime: @@ -201,7 +201,7 @@ class GenCache(object): dead_nodes = set() if self._global_cleanse: try: - for cpv in trg_cache.iterkeys(): + for cpv in trg_cache.keys(): cp = cpv_getkey(cpv) if cp is None: self.returncode |= 1 @@ -221,7 +221,7 @@ class GenCache(object): else: cp_set = self._cp_set try: - for cpv in trg_cache.iterkeys(): + for cpv in trg_cache.keys(): cp = cpv_getkey(cpv) if cp is None: self.returncode |= 1 diff --git a/bin/emaint b/bin/emaint index 407f8a66d..611c323da 100755 --- a/bin/emaint +++ b/bin/emaint @@ -209,7 +209,7 @@ class BinhostHandler(object): bintree.populated = False del pkgindex.packages[:] - pkgindex.packages.extend(metadata.itervalues()) + pkgindex.packages.extend(metadata.values()) from portage.util import atomic_ofstream f = atomic_ofstream(self._pkgindex_file) try: @@ -475,7 +475,7 @@ def emaint_main(myargv): "cleanresume":CleanResume } - module_names = modules.keys() + module_names = list(modules.keys()) module_names.sort() module_names.insert(0, "all") diff --git a/bin/glsa-check b/bin/glsa-check index e9c28f9e6..787cf39db 100755 --- a/bin/glsa-check +++ b/bin/glsa-check @@ -172,7 +172,7 @@ def summarylist(myglsalist, fd1=sys.stdout, fd2=sys.stderr): fd1.write(color(myglsa.nr) + " " + color(status) + " " + color(access) + myglsa.title + " (") if not verbose: - for pkg in myglsa.packages.keys()[:3]: + for pkg in list(myglsa.packages.keys())[:3]: fd1.write(" " + pkg + " ") if len(myglsa.packages) > 3: fd1.write("... ") diff --git a/bin/portageq b/bin/portageq index 34c4fb401..cea14231f 100755 --- a/bin/portageq +++ b/bin/portageq @@ -222,7 +222,7 @@ def owners(argv): owners = vardb._owners.get_owners(files) msg = [] - for pkg, owned_files in owners.iteritems(): + for pkg, owned_files in owners.items(): cpv = pkg.mycpv msg.append("%s\n" % cpv) for f in sorted(owned_files): @@ -560,7 +560,7 @@ def usage(argv): # non_commands = frozenset(['exithandler', 'main', 'usage', 'writemsg', 'writemsg_stdout']) - commands = sorted(k for k, v in globals().iteritems() \ + commands = sorted(k for k, v in globals().items() \ if type(v) is types.FunctionType and k not in non_commands) for name in commands: diff --git a/bin/quickpkg b/bin/quickpkg index fd1728570..383fe20fb 100755 --- a/bin/quickpkg +++ b/bin/quickpkg @@ -124,7 +124,7 @@ def quickpkg_main(options, args, eout): required_metadata["CATEGORY"] = category required_metadata["PF"] = pf update_metadata = {} - for k, v in required_metadata.iteritems(): + for k, v in required_metadata.items(): if v != existing_metadata[k]: update_metadata[k] = v if update_metadata: diff --git a/bin/repoman b/bin/repoman index 13c126e30..950226206 100755 --- a/bin/repoman +++ b/bin/repoman @@ -153,7 +153,7 @@ def ParseArgs(args, qahelp): 'scan' : 'Scan directory tree for QA issues' } - mode_keys = modes.keys() + mode_keys = list(modes.keys()) mode_keys.sort() parser = RepomanOptionParser(formatter=RepomanHelpFormatter(), usage="%prog [options] [mode]") @@ -198,7 +198,7 @@ def ParseArgs(args, qahelp): parser.add_option('--without-mask', dest='without_mask', action='store_true', default=False, help='behave as if no package.mask entries exist (not allowed with commit mode)') - parser.add_option('--mode', type='choice', dest='mode', choices=modes.keys(), + parser.add_option('--mode', type='choice', dest='mode', choices=list(modes.keys()), help='specify which mode repoman will run in (default=full)') parser.on_tail("\n " + green("Modes".ljust(20) + " Description\n")) @@ -208,7 +208,7 @@ def ParseArgs(args, qahelp): parser.on_tail("\n " + green("QA keyword".ljust(20) + " Description\n")) - sorted_qa = qahelp.keys() + sorted_qa = list(qahelp.keys()) sorted_qa.sort() for k in sorted_qa: parser.on_tail(" %s %s\n" % (k.ljust(20), qahelp[k])) @@ -330,7 +330,7 @@ qahelp={ "upstream.workaround":"The ebuild works around an upstream bug, an upstream bug should be filed and tracked in bugs.gentoo.org" } -qacats = qahelp.keys() +qacats = list(qahelp.keys()) qacats.sort() qawarnings = set(( @@ -735,7 +735,7 @@ def dev_keywords(profiles): want to add the --include-dev option. """ type_arch_map = {} - for arch, arch_profiles in profiles.iteritems(): + for arch, arch_profiles in profiles.items(): for prof in arch_profiles: arch_set = type_arch_map.get(prof.status) if arch_set is None: @@ -872,7 +872,7 @@ check_ebuild_notadded = not \ (vcs == "svn" and repolevel < 3 and options.mode != "commit") # Build a regex from thirdpartymirrors for the SRC_URI.mirror check. -thirdpartymirrors = portage.flatten(repoman_settings.thirdpartymirrors().values()) +thirdpartymirrors = portage.flatten(list(repoman_settings.thirdpartymirrors().values())) for x in scanlist: #ebuilds and digests added to cvs respectively. @@ -900,7 +900,7 @@ for x in scanlist: fetchlist_dict=fetchlist_dict) mf.create(requiredDistfiles=None, assumeDistHashesAlways=True) - for distfiles in fetchlist_dict.itervalues(): + for distfiles in fetchlist_dict.values(): for distfile in distfiles: if os.path.isfile(os.path.join(distdir, distfile)): mf.fhashdict['DIST'].pop(distfile, None) @@ -1242,7 +1242,7 @@ for x in scanlist: pkg = pkgs[y] if pkg.invalid: - for k, msgs in pkg.invalid.iteritems(): + for k, msgs in pkg.invalid.items(): for msg in msgs: stats[k] = stats[k] + 1 fails[k].append("%s %s" % (relative_path, msg)) @@ -1253,7 +1253,7 @@ for x in scanlist: inherited = pkg.inherited live_ebuild = live_eclasses.intersection(inherited) - for k, v in myaux.iteritems(): + for k, v in myaux.items(): if not isinstance(v, basestring): continue m = non_ascii_re.search(v) -- cgit v1.2.3-1-g7c22