def process(mysettings, cpv, logentries, fulltext):
elogfilename = elog_modules.mod_save.process(mysettings, cpv, logentries, fulltext)
- if (not "PORTAGE_ELOG_COMMAND" in mysettings.keys()) \
- or len(mysettings["PORTAGE_ELOG_COMMAND"]) == 0:
+ if not mysettings.get("PORTAGE_ELOG_COMMAND"):
raise portage_exception.MissingParameter("!!! Custom logging requested but PORTAGE_ELOG_COMMAND is not defined")
else:
mylogcmd = mysettings["PORTAGE_ELOG_COMMAND"]
def finalize(mysettings):
printer = EOutput()
- for key in _items.keys():
+ for key in _items:
print
printer.einfo("Messages for package %s:" % key)
print
mybody = "elog messages for the following packages generated by " + \
"process %d on host %s:\n" % (os.getpid(), socket.getfqdn())
- for cpv in _items.keys():
+ for cpv in _items:
mybody += "- %s\n" % cpv
mymessage = portage_mail.create_message(myfrom, myrecipient, mysubject, mybody, attachments=_items.values())
for x in tbz2list:
x = os.path.basename(x)
binpkg_filenames.add(x)
- if ((not metadata[baseurl]["data"].has_key(x)) or \
- (x not in metadata[baseurl]["data"].keys())):
+ if x not in metadata[baseurl]["data"]:
sys.stderr.write(yellow("x"))
metadata[baseurl]["modified"] = 1
myid = None
results.append("Found %(count)s locks" % {"count":mycount})
- for x in mylist.keys():
+ for x in mylist:
if mylist[x].has_key(myhost) or remove_all_locks:
mylockname = hardlock_name(path+"/"+x)
if hardlink_is_mine(mylockname, path+"/"+x) or \
not os.path.exists(path+"/"+x) or \
remove_all_locks:
- for y in mylist[x].keys():
+ for y in mylist[x]:
for z in mylist[x][y]:
filename = path+"/"+x+".hardlock-"+y+"-"+z
if filename == mylockname:
class Manifest1Entry(ManifestEntry):
def __str__(self):
- myhashkeys = self.hashes.keys()
- for hashkey in myhashkeys:
+ for hashkey in self.hashes:
if hashkey != "size":
break
hashvalue = self.hashes[hashkey]