Replace dict.has_key() calls with "in" and "not in" operators.
svn path=/main/trunk/; revision=10873
ebuild_logentries = collect_ebuild_messages(os.path.join(mysettings["T"], "logging"))
all_logentries = collect_messages()
- if all_logentries.has_key(cpv):
+ if cpv in all_logentries:
all_logentries[cpv] = _merge_logentries(ebuild_logentries, all_logentries[cpv])
else:
all_logentries[cpv] = ebuild_logentries
for key in _preserve_logentries.keys():
- if all_logentries.has_key(key):
+ if key in all_logentries:
all_logentries[key] = _merge_logentries(_preserve_logentries[key], all_logentries[key])
else:
all_logentries[key] = _preserve_logentries[key]
for phase in logentries:
for msgtype, msgcontent in logentries[phase]:
if msgtype.upper() in loglevels or "*" in loglevels:
- if not rValue.has_key(phase):
+ if phase not in rValue:
rValue[phase] = []
rValue[phase].append((msgtype, msgcontent))
return rValue
if color == None:
color = "GOOD"
print colorize(color, " * ")+msg
- if not _msgbuffer.has_key(key):
+ if key not in _msgbuffer:
_msgbuffer[key] = {}
- if not _msgbuffer[key].has_key(phase):
+ if phase not in _msgbuffer[key]:
_msgbuffer[key][phase] = []
_msgbuffer[key][phase].append((level, msg))
from portage.util import writemsg
def process(mysettings, key, logentries, fulltext):
- if mysettings.has_key("PORTAGE_ELOG_MAILURI"):
+ if "PORTAGE_ELOG_MAILURI" in mysettings:
myrecipient = mysettings["PORTAGE_ELOG_MAILURI"].split()[0]
else:
myrecipient = "root@localhost"
count = "one package"
else:
count = "multiple packages"
- if mysettings.has_key("PORTAGE_ELOG_MAILURI"):
+ if "PORTAGE_ELOG_MAILURI" in mysettings:
myrecipient = mysettings["PORTAGE_ELOG_MAILURI"].split()[0]
else:
myrecipient = "root@localhost"