public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] portage r10873 - main/trunk/pym/portage/elog
@ 2008-07-01 12:50 Zac Medico (zmedico)
  0 siblings, 0 replies; only message in thread
From: Zac Medico (zmedico) @ 2008-07-01 12:50 UTC (permalink / raw
  To: gentoo-commits

Author: zmedico
Date: 2008-07-01 12:50:41 +0000 (Tue, 01 Jul 2008)
New Revision: 10873

Modified:
   main/trunk/pym/portage/elog/__init__.py
   main/trunk/pym/portage/elog/filtering.py
   main/trunk/pym/portage/elog/messages.py
   main/trunk/pym/portage/elog/mod_mail.py
   main/trunk/pym/portage/elog/mod_mail_summary.py
Log:
Py3k compatibility patch #4 by Ali Polatel <hawking@g.o>.
Replace dict.has_key() calls with "in" and "not in" operators.


Modified: main/trunk/pym/portage/elog/__init__.py
===================================================================
--- main/trunk/pym/portage/elog/__init__.py	2008-07-01 12:48:57 UTC (rev 10872)
+++ main/trunk/pym/portage/elog/__init__.py	2008-07-01 12:50:41 UTC (rev 10873)
@@ -73,13 +73,13 @@
 
 	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]

Modified: main/trunk/pym/portage/elog/filtering.py
===================================================================
--- main/trunk/pym/portage/elog/filtering.py	2008-07-01 12:48:57 UTC (rev 10872)
+++ main/trunk/pym/portage/elog/filtering.py	2008-07-01 12:50:41 UTC (rev 10873)
@@ -12,7 +12,7 @@
 	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

Modified: main/trunk/pym/portage/elog/messages.py
===================================================================
--- main/trunk/pym/portage/elog/messages.py	2008-07-01 12:48:57 UTC (rev 10872)
+++ main/trunk/pym/portage/elog/messages.py	2008-07-01 12:50:41 UTC (rev 10873)
@@ -76,9 +76,9 @@
 	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))
 

Modified: main/trunk/pym/portage/elog/mod_mail.py
===================================================================
--- main/trunk/pym/portage/elog/mod_mail.py	2008-07-01 12:48:57 UTC (rev 10872)
+++ main/trunk/pym/portage/elog/mod_mail.py	2008-07-01 12:50:41 UTC (rev 10873)
@@ -8,7 +8,7 @@
 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"

Modified: main/trunk/pym/portage/elog/mod_mail_summary.py
===================================================================
--- main/trunk/pym/portage/elog/mod_mail_summary.py	2008-07-01 12:48:57 UTC (rev 10872)
+++ main/trunk/pym/portage/elog/mod_mail_summary.py	2008-07-01 12:50:41 UTC (rev 10873)
@@ -33,7 +33,7 @@
 		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"

-- 
gentoo-commits@lists.gentoo.org mailing list



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-07-01 12:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-01 12:50 [gentoo-commits] portage r10873 - main/trunk/pym/portage/elog Zac Medico (zmedico)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox