rev 3568 - scripts

Pierre Habouzit madcoder at costa.debian.org
Mon Apr 17 16:28:48 UTC 2006


Author: madcoder
Date: 2006-04-17 16:28:48 +0000 (Mon, 17 Apr 2006)
New Revision: 3568

Modified:
   scripts/bzlink.py
Log:
small optimizations.
make createMail agnostic of the 'From' so that gnome and other projects
can use the script only needing to modify the "main" function



Modified: scripts/bzlink.py
===================================================================
--- scripts/bzlink.py	2006-04-17 16:26:53 UTC (rev 3567)
+++ scripts/bzlink.py	2006-04-17 16:28:48 UTC (rev 3568)
@@ -127,7 +127,7 @@
             return '\n'.join(btscmds)
         return None
 
-def createMail(bzm, bug):
+def createMail(From, bzm, bug):
     cmds = bzm.createCmds(bug)
 
     to = []
@@ -145,7 +145,7 @@
     body = '\n\n'.join(body)
 
     mail = MIMEText(body)
-    mail['From'] = 'debian-qt-kde at lists.debian.org'
+    mail['From'] = From
     mail['To'] = ', '.join(to)
     mail['X-Debbugs-No-Ack'] = 'no-acks' # actual value is not used, http://www.debian.org/Bugs/Reporting
     try:
@@ -153,7 +153,7 @@
     except:
         mail['Content-Type'] = 'text/plain; charset="utf-8"'
 
-    return mail
+    return mail, to
 
 patterns = [ "http://bugs.kde.org/show_bug.cgi?id=%i",
              "http://bugs.kde.org/%i",
@@ -171,11 +171,11 @@
     else:
         bug = bug['debbugsID'][0]
 
-    msg = createMail(bzm, bug)
+    msg, to = createMail('debian-qt-kde at lists.debian.org', bzm, bug)
 
     s = smtplib.SMTP()
     s.connect()
-    s.sendmail(msg['From'], msg['To'].split(', '), msg.as_string())
+    s.sendmail(msg['From'], to, msg.as_string())
     s.close()
 
 # vim:set foldmethod=indent foldnestmax=1:




More information about the pkg-kde-commits mailing list