changeset 537:b72243e52317

Some style clean-ups to notify.py
author mgood
date Mon, 23 Mar 2009 00:08:08 +0000
parents 1f29360d8fd0
children 23b7bdfb878d
files bitten/notify.py
diffstat 1 files changed, 7 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/bitten/notify.py
+++ b/bitten/notify.py
@@ -162,17 +162,17 @@
 
     def get_recipients(self, resid):
         author = self.build_info.author
-        users = {}
-        [users.__setitem__(username, email) for username, name, email in self.env.get_known_users(None)]
-        if (author in users.keys() and users[author]):
-            author = users[author]
+        user_emails = dict([(username, email) for username, name, email
+                            in self.env.get_known_users(None)])
+        author = user_emails.get(author) or author
         torecipients = [author]
         ccrecipients = []
         return (torecipients, ccrecipients)
 
     def send(self, torcpts, ccrcpts, mime_headers={}):
-        mime_headers = {}
-        mime_headers['X-Trac-Build-ID'] = str(self.build_info.id)
-        mime_headers['X-Trac-Build-URL'] = self.build_info.link
+        mime_headers = {
+            'X-Trac-Build-ID': str(self.build_info.id),
+            'X-Trac-Build-URL': self.build_info.link,
+        }
         NotifyEmail.send(self, torcpts, ccrcpts, mime_headers)
 
Copyright (C) 2012-2017 Edgewall Software