both python 2.x and 3.x.
svn path=/main/trunk/; revision=14384
return mydict
def get_valid_checksum_keys():
- return list(hashfunc_map.keys())
+ return list(hashfunc_map)
def get_hash_origin(hashtype):
if hashtype not in hashfunc_map:
self.settings["PORTAGE_BINHOST"], chunk_size=chunk_size)
#writemsg(green(" -- DONE!\n\n"))
- for mypkg in self.remotepkgs.keys():
+ for mypkg in list(self.remotepkgs):
if "CATEGORY" not in self.remotepkgs[mypkg]:
#old-style or corrupt package
writemsg(_("!!! Invalid remote binary package: %s\n") % mypkg,
y == "CVS":
continue
d[x+"/"+y] = None
- l = list(d.keys())
+ l = list(d)
l.sort()
return l
(mycp, self.mysettings["PORTAGE_CONFIGROOT"]), noiselevel=-1)
mylist = []
else:
- mylist = list(d.keys())
+ mylist = list(d)
# Always sort in ascending order here since it's handy
# and the result can be easily cached and reused.
self._cpv_sort_ascending(mylist)
os = _os_merge
- for cps in self._data.keys():
+ for cps in list(self._data):
cpv, counter, paths = self._data[cps]
paths = [f for f in paths \
if os.path.exists(os.path.join(self._root, f.lstrip(os.sep)))]
self.invalidentry(self.getpath(y))
continue
d[mysplit[0]+"/"+mysplit[1]] = None
- return list(d.keys())
+ return list(d)
def checkblockers(self, origdep):
pass
secpass >= 2:
self._owners.populate() # index any unindexed contents
valid_nodes = set(self.cpv_all())
- for cpv in self._aux_cache["packages"].keys():
+ for cpv in list(self._aux_cache["packages"]):
if cpv not in valid_nodes:
del self._aux_cache["packages"][cpv]
del self._aux_cache["modified"]
if pkgfiles:
self.updateprotect()
- mykeys = list(pkgfiles.keys())
+ mykeys = list(pkgfiles)
mykeys.sort()
mykeys.reverse()
curval = 0
if onProgress:
onProgress(maxval, 0)
- paths = list(contents.keys())
+ paths = list(contents)
paths.sort()
for path in paths:
curval += 1
return list(self.cpdict)
def cpv_all(self):
- return list(self.cpvdict.keys())
+ return list(self.cpvdict)
def cpv_inject(self, mycpv, metadata=None):
"""Adds a cpv to the list of available packages. See the
else:
all_logentries[cpv] = ebuild_logentries
- for key in list(_preserve_logentries.keys()):
+ for key in list(_preserve_logentries):
if key in all_logentries:
all_logentries[key] = _merge_logentries(_preserve_logentries[key], all_logentries[key])
else:
# look at the phases listed in our logentries to figure out what action was performed
action = _("merged")
- for phase in logentries.keys():
+ for phase in logentries:
# if we found a *rm phase assume that the package was unmerged
if phase in ["postrm", "prerm"]:
action = _("unmerged")
# if we think that the package was unmerged, make sure there was no unexpected
# phase recorded to avoid misinformation
if action == _("unmerged"):
- for phase in logentries.keys():
+ for phase in logentries:
if phase not in ["postrm", "prerm", "other"]:
action = _("unknown")