use filter instead of list comprehension

This commit is contained in:
Andreas Preikschat 2012-04-05 17:16:47 +02:00
parent dbe9fc51aa
commit 704795830d

View File

@ -377,13 +377,13 @@ class BibleMediaItem(MediaManagerItem):
self.advancedSecondComboBox.addItem(u'') self.advancedSecondComboBox.addItem(u'')
# Get all bibles and sort the list. # Get all bibles and sort the list.
bibles = self.plugin.manager.get_bibles().keys() bibles = self.plugin.manager.get_bibles().keys()
bibles = filter(None, bibles)
bibles.sort(cmp=locale.strcoll) bibles.sort(cmp=locale.strcoll)
# Load the bibles into the combo boxes. # Load the bibles into the combo boxes.
tmp_bibles = [bible for bible in bibles if bible] self.quickVersionComboBox.addItems(bibles)
self.quickVersionComboBox.addItems(tmp_bibles) self.quickSecondComboBox.addItems(bibles)
self.quickSecondComboBox.addItems(tmp_bibles) self.advancedVersionComboBox.addItems(bibles)
self.advancedVersionComboBox.addItems(tmp_bibles) self.advancedSecondComboBox.addItems(bibles)
self.advancedSecondComboBox.addItems(tmp_bibles)
# set the default value # set the default value
bible = QtCore.QSettings().value( bible = QtCore.QSettings().value(
self.settingsSection + u'/advanced bible', self.settingsSection + u'/advanced bible',