Replace lambdas with list comprehensions
svn: r10843
This commit is contained in:
parent
7120655439
commit
6037e9fdd4
@ -1364,7 +1364,7 @@ class GrampsDbBase(Callback):
|
|||||||
data = cursor.next()
|
data = cursor.next()
|
||||||
cursor.close()
|
cursor.close()
|
||||||
slist.sort()
|
slist.sort()
|
||||||
return map(lambda x: x[1], slist)
|
return [x[1] for x in slist]
|
||||||
else:
|
else:
|
||||||
return self.all_handles(self.person_map)
|
return self.all_handles(self.person_map)
|
||||||
return []
|
return []
|
||||||
@ -1386,8 +1386,7 @@ class GrampsDbBase(Callback):
|
|||||||
data = cursor.next()
|
data = cursor.next()
|
||||||
cursor.close()
|
cursor.close()
|
||||||
slist.sort()
|
slist.sort()
|
||||||
val = map(lambda x: x[1], slist)
|
return [x[1] for x in slist]
|
||||||
return val
|
|
||||||
else:
|
else:
|
||||||
return self.all_handles(self.place_map)
|
return self.all_handles(self.place_map)
|
||||||
return []
|
return []
|
||||||
|
@ -3235,9 +3235,9 @@ def sort_people(db, handle_list):
|
|||||||
temp_list = sname_sub.keys()
|
temp_list = sname_sub.keys()
|
||||||
temp_list.sort(locale.strcoll)
|
temp_list.sort(locale.strcoll)
|
||||||
for name in temp_list:
|
for name in temp_list:
|
||||||
slist = map(lambda x: (sortnames[x], x), sname_sub[name])
|
slist = [(sortnames[x], x) for x in sname_sub[name]]
|
||||||
slist.sort(lambda x, y: locale.strcoll(x[0], y[0]))
|
slist.sort(lambda x, y: locale.strcoll(x[0], y[0]))
|
||||||
entries = map(lambda x: x[1], slist)
|
entries = [x[1] for x in slist]
|
||||||
sorted_lists.append((name, entries))
|
sorted_lists.append((name, entries))
|
||||||
return sorted_lists
|
return sorted_lists
|
||||||
|
|
||||||
|
@ -129,10 +129,10 @@ class GeneWebWriterOptionBox:
|
|||||||
|
|
||||||
def on_restrict_toggled(self, restrict):
|
def on_restrict_toggled(self, restrict):
|
||||||
active = restrict.get_active ()
|
active = restrict.get_active ()
|
||||||
map (lambda x: x.set_sensitive (active),
|
for x in [self.topDialog.get_widget("living"),
|
||||||
[self.topDialog.get_widget("living"),
|
self.topDialog.get_widget("notes"),
|
||||||
self.topDialog.get_widget("notes"),
|
self.topDialog.get_widget("sources")]:
|
||||||
self.topDialog.get_widget("sources")])
|
x.set_sensitive(active)
|
||||||
|
|
||||||
def parse_options(self):
|
def parse_options(self):
|
||||||
self.restrict = self.topDialog.get_widget("restrict").get_active()
|
self.restrict = self.topDialog.get_widget("restrict").get_active()
|
||||||
|
Loading…
Reference in New Issue
Block a user