List comprehension fits better

This commit is contained in:
Alexander Cherniuk 2010-03-26 14:52:54 +02:00
parent 5ea5309035
commit aed9179d15
1 changed files with 2 additions and 2 deletions

View File

@ -182,8 +182,8 @@ class StandardCommonChatCommands(CommandContainer):
def dtmf(self, events):
if not self.audio_sid:
raise CommandError(_("There is no open audio session with this contact"))
# Valid values for DTMF tones are *, # or a number
events = filter(lambda e: e in ('*', '#') or e.isdigit (), events)
# Valid values for DTMF tones are *, # or a number.
events = [e for e in events if e in ('*', '#') or e.isdigit()]
if events:
session = gajim.connections[self.account].get_jingle_session(
self.contact.get_full_jid(), self.audio_sid)