FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo Portage Developer

 
 
LinkBack Thread Tools
 
Old 07-01-2008, 11:26 AM
Ali Polatel
 
Default Replace has_key() with the in operator (portage.elog)

---
pym/portage/elog/__init__.py | 4 ++--
pym/portage/elog/filtering.py | 2 +-
pym/portage/elog/messages.py | 4 ++--
pym/portage/elog/mod_mail.py | 2 +-
pym/portage/elog/mod_mail_summary.py | 2 +-
5 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/pym/portage/elog/__init__.py b/pym/portage/elog/__init__.py
index 3039370..ea81e84 100644
--- a/pym/portage/elog/__init__.py
+++ b/pym/portage/elog/__init__.py
@@ -73,13 +73,13 @@ def elog_process(cpv, mysettings, phasefilter=None):

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]
diff --git a/pym/portage/elog/filtering.py b/pym/portage/elog/filtering.py
index c93085c..d33d312 100644
--- a/pym/portage/elog/filtering.py
+++ b/pym/portage/elog/filtering.py
@@ -12,7 +12,7 @@ def filter_loglevels(logentries, loglevels):
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
diff --git a/pym/portage/elog/messages.py b/pym/portage/elog/messages.py
index 2daacd1..ac8d701 100644
--- a/pym/portage/elog/messages.py
+++ b/pym/portage/elog/messages.py
@@ -76,9 +76,9 @@ def _elog_base(level, msg, phase="other", key=None, color=None):
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))

diff --git a/pym/portage/elog/mod_mail.py b/pym/portage/elog/mod_mail.py
index 09e3db2..d6383a4 100644
--- a/pym/portage/elog/mod_mail.py
+++ b/pym/portage/elog/mod_mail.py
@@ -8,7 +8,7 @@ from portage.exception import PortageException
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"
diff --git a/pym/portage/elog/mod_mail_summary.py b/pym/portage/elog/mod_mail_summary.py
index 8f7f862..ed51473 100644
--- a/pym/portage/elog/mod_mail_summary.py
+++ b/pym/portage/elog/mod_mail_summary.py
@@ -33,7 +33,7 @@ def _finalize(mysettings, items):
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"
--
1.5.6.1

--
gentoo-portage-dev@lists.gentoo.org mailing list
 

Thread Tools




All times are GMT. The time now is 03:25 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org