]> git.decadent.org.uk Git - dak.git/blobdiff - dak/bts_categorize.py
Merge commit 'godog/master' into merge
[dak.git] / dak / bts_categorize.py
index 1a4548e67c07d2766bcc7dfa60b6d0b68c629e36..663690a1973d9e767c71147bba66dd9c44e50a1b 100755 (executable)
@@ -1,9 +1,13 @@
 #!/usr/bin/python
 
-#  bts -- manage bugs filed against ftp.debian.org
-#
-#  Copyright 2009 Mike O'Connor <stew@vireo.org>
-#
+"""
+bts -- manage bugs filed against ftp.debian.org
+
+@contact: Debian FTP Master <ftpmaster@debian.org>
+@copyright: 2009 Mike O'Connor <stew@vireo.org>
+@license: GNU General Public License version 2 or later
+"""
+
 #  This program is free software; you can redistribute it and/or modify it
 #  under the terms of the GNU General Public License as published by the
 #  Free Software Foundation; either version 2, or (at your option) any
@@ -118,15 +122,16 @@ class BugClassifier(object):
         controls = ""
 
         bc = BugClassifier()
-        for bug in bc.unclassified_bugs():
-            controls += bc.classify_bug(bug)
-
-        return controls
+        try:
+            for bug in bc.unclassified_bugs():
+                controls += bc.classify_bug(bug)
 
-import smtplib
-import email.Message
+            return controls
+        except:
+            log.error("couldn't retrieve bugs from soap interface: %s" % sys.exc_info()[0])
+            return None
 
-def send_email(commands, simulate):
+def send_email(commands, simulate=False):
     global Cnf
 
     Subst = {'__COMMANDS__' : commands,