Bug 3018: remove calls to keys() dictionary method where possible

svn: r12562
This commit is contained in:
Gerald Britton
2009-05-22 18:43:40 +00:00
parent 5c9d8ab7ff
commit fc90d5fce2
16 changed files with 45 additions and 47 deletions

View File

@@ -379,7 +379,7 @@ class Extract(object):
value = [_("Personal information missing")]
# list of information found
for key in value:
if key in chart[1].keys():
if key in chart[1]:
chart[1][key] += 1
else:
chart[1][key] = 1
@@ -408,7 +408,7 @@ class Extract(object):
data = []
ext = self.extractors
# which methods to use
for name in self.extractors.keys():
for name in self.extractors:
option = menu.get_option_by_name(name)
if option.get_value() == True:
# localized data title, value dict, type and data method

View File

@@ -268,7 +268,7 @@ class CSVWriter(object):
family = self.db.get_family_from_handle(family_handle)
for child_ref in family.get_child_ref_list():
child_handle = child_ref.ref
if child_handle in self.plist.keys():
if child_handle in self.plist:
self.flist[family_handle] = 1
def update_empty(self):

View File

@@ -345,7 +345,7 @@ class CSVParser(object):
return self.lookup(type, id)
else:
return db_lookup
elif id.lower() in self.fref.keys():
elif id.lower() in self.fref:
return self.fref[id.lower()]
else:
return None
@@ -357,7 +357,7 @@ class CSVParser(object):
return self.lookup(type, id)
else:
return db_lookup
elif id.lower() in self.pref.keys():
elif id.lower() in self.pref:
return self.pref[id.lower()]
else:
return None